Picker Error Message on Exit (encountered while discovering extensions: Error Domain=PlugInKit Code=13) With Swift 4 - Xcode 9

前端 未结 10 1134
生来不讨喜
生来不讨喜 2021-01-31 10:04

Similar to

PhotoPicker discovery error: Error Domain=PlugInKit Code=13

and also to

https://forums.developer.apple.com/thread/82105

BUT I have t

10条回答
  •  借酒劲吻你
    2021-01-31 10:56

    For Swift 4:

    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
        guard let pickedImage = info[UIImagePickerController.InfoKey.originalImage] as? UIImage else {
            return
        }
        ...
    }
    
    • On method parameter, change from [String: Any] to [UIImagePickerController.InfoKey : Any]
    • On the picked image, change from info["UIImagePickerControllerOriginalImage"] to info[UIImagePickerController.InfoKey.originalImage]

提交回复
热议问题