试图将聊天客户端从 swift 4 传递到 swift 4.2 并使用选择器我发现了麻烦。
UIImagePickerControllerEditedImage 无法使用“UIImagePickerController.InfoKey”类型的索引为“[String : Any]”类型的值下标
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)
}