AI
Size: a a a
AI
G
n

IS
extension UIView { func snapshot() -> UIImage? {
UIGraphicsBeginImageContextWithOptions(frame.size, false, UIScreen.main.scale)
if let ctx = UIGraphicsGetCurrentContext() {
layer.render(in: ctx)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}
return nil
}A
G
IS
IS
G
D
KD
AY
ॐХ