ios - AVCaptureDevice.requestAccess() crash -
i created ios single view application using swift 3.0 , xcode 8 beta 2. linking avfoundation.framework
.
this view controller code:
import uikit import avfoundation class viewcontroller: uiviewcontroller { override func viewdidload() { super.viewdidload() if avcapturedevice.authorizationstatus(formediatype: avmediatypevideo) == .notdetermined { avcapturedevice.requestaccess(formediatype: avmediatypevideo, completionhandler: { (granted: bool) in if granted { print("granted") } else { print("not granted") } }) } } }
when run on device app crashes after executing avcapture.requestaccess
line (the completion handler not executed , no exceptions thrown).
the thing in console is:
2016-07-15 14:55:44.621819 testpp[2261:912051] [mc] system group container systemgroup.com.apple.configurationprofiles path /private/var/containers/shared/systemgroup/systemgroup.com.apple.configurationprofiles 2016-07-15 14:55:44.626012 testpp[2261:912051] [mc] reading public effective user settings. 2016-07-15 14:55:59.284610 testpp[2261:912085] [access] <private>
am doing wrong?
make sure set value privacy - camera usage description
key in info.plist
file when requesting camera access.
Comments
Post a Comment