Taking a snapshot
suggest changeYou can take a snapshot from a UIView like this. snapshotView(afterScreenUpdates:) (Swift 3) and snapshotViewAfterScreenUpdates: return another UIView, not a UIImage, and the result can be nil if the view has not been rendered:
Swift
let snapshot = view.snapshotView(afterScreenUpdates: true)
Objective-C
UIView *snapshot = [view snapshotViewAfterScreenUpdates: YES];
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents