Tag: uiimage

UIGraphicsImageRenderer so much slower than UIGraphicsBeginImageContextWithOption

问题内容: I came across quite an odd issue. When testing my code to create a UIImage I found that using UIGraphicsImageRenderer was so much slower than when using UIGraphicsBeginImageContextWithOption. When drawing 5 large images I found using UIGraphicsBeginImageContextWithOption would render it in 0.3 seconds while using UIGraphicsImageRenderer would render the images in 13.3 seconds. When

Displaying selected image on screen using UIIamgePickerControllerDelegate in Swift

问题内容: I am attempting to learn more about the delegate pattern. I have written an app that accesses the user’s camera roll and I want to display that image on the view controller after the user selects the image. Here is what I have thus far: import UIKit class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { @IBOutlet