Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor. Move showNoCamera into mainQueue #136

Merged
merged 2 commits into from
Apr 7, 2016
Merged

Conversation

onmyway133
Copy link
Contributor

Problem

  • Open ImagePicker
  • Deny access 😆
  • Crash "This application is not allowed to access Photo data."

Then, we should

@@ -168,6 +164,17 @@ class CameraView: UIViewController, CLLocationManagerDelegate {

if captureDevice != nil { beginSession() }
}

func handlePermission(granted: Bool, device: AVCaptureDevice) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onmyway133 I generally see overuse of self in hyperoslo's projects. Feels like ObjC-ish

this is sufficient i think

func handlePermission(granted: Bool, device: AVCaptureDevice) {
    if granted {
      captureDevice = device
      capturedDevices?.addObject(device)
    }

    dispatch_async(dispatch_get_main_queue()) {
      self.showNoCamera(!granted)
    }
  }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually tend to not use self, or try not to! But nice catch! :)

@onmyway133
Copy link
Contributor Author

@aashishdhawan @RamonGilabert fixed ☺️

@RamonGilabert RamonGilabert merged commit 8224f96 into master Apr 7, 2016
@RamonGilabert RamonGilabert deleted the fix/photo branch April 7, 2016 07:55
@aashishdhawan aashishdhawan mentioned this pull request May 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants