Skip to content

Instantly share code, notes, and snippets.

@lloydsheng
Last active March 19, 2018 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lloydsheng/4ebbf17a60302b99d71f21156d1936fd to your computer and use it in GitHub Desktop.
Save lloydsheng/4ebbf17a60302b99d71f21156d1936fd to your computer and use it in GitHub Desktop.
UIGraphicsBeginImageContextWithOptions(snapshotView.bounds.size, true, 0.0)
snapshotView.drawHierarchy(in: snapshotView.bounds, afterScreenUpdates: true)
let snapshotImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
print("\(snapshotImage.debugDescription)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment