Overriding non-@objc declarations from extensions is not supported
原因: 不支持从扩展中覆盖non-@objc声明
解决:将方法写到主类里
Cannot subscript a value of type ‘[String : Any]’ with an index of type ‘UIImagePickerController.InfoKey’
最初代码:
var image:UIImage? = info[UIImagePickerControllerEditedImage] as? UIImage
修改:
var image:UIImage? = info[UIImagePickerController.InfoKey.editedImage.rawValue] as? UIImage
‘…<’ is unavailable: Any String view index conversion can fail in Swift 4; please unwrap the optional indices
原因: 可选值进行对比
解决: 解包