IOS普通截图

//这个例子是直接截取的viewController
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, false, UIScreen.main.scale)
self.view.layer.render(in: UIGraphicsGetCurrentContext()!)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()

你可能感兴趣的:(IOS普通截图)