//保存视图
pragma mark - 保存视图
UIGraphicsBeginImageContext(self.qrView.bounds.size);
[self.qrView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
pragma mark - 保存图片
UIImage *image;
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
//结果
- (void)image:(UIImage )image didFinishSavingWithError:(NSError )error contextInfo:(void *)contextInfo{
if (error) {
NSLog(@”失败”);
}else{
NSLog(@”成功”);
}
}