标签:
func saveToLocal() { //截屏 let screenRect = UIScreen.mainScreen().bounds UIGraphicsBeginImageContext(screenRect.size) let ctx:CGContextRef = UIGraphicsGetCurrentContext()! self.view.layer.renderInContext(ctx) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext(); //保存相册 UIImageWriteToSavedPhotosAlbum(image!, self, "image:didFinishSavingWithError:contextInfo:", nil) } func image(image:UIImage,didFinishSavingWithError error:NSError?,contextInfo:AnyObject) { if error != nil { K12ProgressHUD.showError("保存失败", view: self.view) } else { K12ProgressHUD.showSucess("保存成功", view: self.view) } }
标签:
原文地址:http://www.cnblogs.com/yajunLi/p/5953966.html