“Creating an image format with an unknown type is an error” with UIImagePickerController

后端 未结 23 1845
长发绾君心
长发绾君心 2020-11-28 09:08

While choosing an image from the image picker in iOS 10 Swift 3 I am getting an error - Creating an image format with an unknown type is an error



        
23条回答
  •  隐瞒了意图╮
    2020-11-28 09:24

    According Abdurohman's answer, i change my code and solve the problem,thanks.

    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
        let selectedImage = info[UIImagePickerControllerOriginalImage] as! UIImage
    
        photoImageView.image = selectedImage
    
        // Dismiss the picker.
        dismiss(animated: true, completion: nil)
    }
    

提交回复
热议问题