Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import UIKit
// Snapshot utilities
extension UIView {
func snapshotView(view: UIView, afterUpdates: Bool) -> UIView {
let snapshot = view.snapshotViewAfterScreenUpdates(afterUpdates)
self.addSubview(snapshot)
snapshot.frame = convertRect(view.bounds, fromView: view)
return snapshot
}
func snapshotViews(views: [UIView], afterUpdates: Bool) -> [UIView] {
return views.map { snapshotView($0, afterUpdates: afterUpdates) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.