iOS11 UIImagePickerControllerEditedImage 异常问题
iOS 2020-02-15 19:22:10

原:

PHP Code复制内容到剪贴板
  1. var image = info[UIImagePickerController.InfoKey.init(string: UIImagePickerControllerEditedImage) as String] as? UIImage;  

 

纠正:

PHP Code复制内容到剪贴板
  1. var image = info[UIImagePickerControllerEditedImage] as! UIImage;  

 

 


 

 原:

            guard let imageData = image!.jpegData(compressionQuality: 0.8) else {

                return

            }

纠正:

 

            guard let imageData = UIImageJPEGRepresentation(image, 0.8) else{

                return

            };

 

 


 

原:

       case .large: return rect.inset(by: UIEdgeInsets.init(top: 8, left: 8, bottom: 8 + 12, right: 8))

 

纠正:

       case .large: return UIEdgeInsetsInsetRect(rect, UIEdgeInsets.init(top: 8, left: 8, bottom: 8 + 12, right: 8))

 

 


 

原:

        NotificationCenter.default.addObserver(

            self, selector: #selector(clearMemoryCache), name: UIApplication.didReceiveMemoryWarningNotification, object: nil)

 纠正:

         NotificationCenter.default.addObserver(

        self, selector: #selector(clearMemoryCache), name: NSNotification.Name.UIApplicationDidReceiveMemoryWarning, object: nil)

 


 

 

 

 

 

本文来自于:https://www.jianshu.com/p/1b40dbcc692a

Powered by yoyo苏ICP备15045725号