【发布时间】:2015-01-31 11:24:27
【问题描述】:
目前我正在使用此代码:
@IBAction func selectPicture(sender: UIButton) {
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.PhotoLibrary){
var imag = UIImagePickerController()
imag.delegate = self
imag.sourceType = .Camera;
imag.mediaTypes = [kUTTypeImage as String]
imag.allowsEditing = false
imag.modalPresentationStyle = .Popover
self.presentViewController(imag, animated: true, completion: nil)
}
}
但是当我在iPad 或iPhone 设备上运行它时,它只要求我获得相机许可,我无法从任何相册/相机胶卷中选择照片。
我该怎么做才能从设备访问照片?
【问题讨论】:
标签: ios swift uiimagepickercontroller