Skip to content

Instantly share code, notes, and snippets.

View oitan's full-sized avatar
💯
Focused

Alikhan Oitan oitan

💯
Focused
View GitHub Profile
//taken from: https://www.hackingwithswift.com/example-code/media/how-to-render-a-uiview-to-a-uiimage
//Available from iOS 10.0
let renderer = UIGraphicsImageRenderer(size: view.bounds.size)
let image = renderer.image { ctx in
view.drawHierarchy(in: view.bounds, afterScreenUpdates: true)
}