Skip to content

Commit 0a6641d

Browse files
authored
Merge pull request #293 from mattrubin/scanner-access-completion-queue
Dispatch AVCaptureDevice.requestAccess completion to the main queue
2 parents 8cc2dc7 + 5ad284c commit 0a6641d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Authenticator/Source/QRScanner.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ class QRScanner: NSObject, AVCaptureMetadataOutputObjectsDelegate {
9999
guard !CommandLine.isDemo else {
100100
return
101101
}
102-
AVCaptureDevice.requestAccess(for: .video, completionHandler: completionHandler)
102+
AVCaptureDevice.requestAccess(for: .video) { accessGranted in
103+
DispatchQueue.main.async {
104+
completionHandler(accessGranted)
105+
}
106+
}
103107
}
104108

105109
// MARK: AVCaptureMetadataOutputObjectsDelegate

0 commit comments

Comments
 (0)