I just downloaded the new Xcode 7 beta 5 and I cannot find a way to resolve this error. It keeps highlighting the line "pickker.mediaTypes = [kUTTypeImage]" and says "Cannot assign a value of type '[CFString]' to a value of type '[String]'"
if (UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera)){
let picker = UIImagePickerController()
picker.delegate = self
picker.sourceType = UIImagePickerControllerSourceType.Camera
picker.mediaTypes = [kUTTypeImage]
picker.allowsEditing = true
self.presentViewController(picker, animated: true, completion: nil)
}
else{
NSLog("No Camera.")
}
Try casting the CFString to a String like so:
picker.mediaTypes = [kUTTypeImage as String]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With