Swift 4.2 imagePickerController issue

后端 未结 6 1709
清歌不尽
清歌不尽 2020-12-09 19:46

Trying to pass chat client from swift 4 to swift 4.2 and with picker i found trouble.

UIImagePickerControllerEditedImage Cannot subscript a value of

6条回答
  •  时光说笑
    2020-12-09 19:50

    extension CameraViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
    
        func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
            if let chosenImage = info[.originalImage] as? UIImage {
                selectedImage = chosenImage
                photo.image = chosenImage
            }
            dismiss(animated: true, completion: nil)
        }
    }
    

    Above code solved the warning and image successfully uploaded

提交回复
热议问题