Trying to pass chat client from swift 4 to swift 4.2 and with picker i found trouble.
UIImagePickerControllerEditedImage Cannot subscript a value of type
'[String : Any]' with an index of type
'UIImagePickerController.InfoKey'
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
if let pickedImage = info[UIImagePickerControllerEditedImage] as? UIImage {
self.userProfileImage.contentMode = .scaleAspectFit
self.userProfileImage.image = pickedImage
}
picker.dismiss(animated: true, completion: nil)
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…