- (void)savePicToPhotoes
{
UIGraphicsBeginImageContext(self.view.bounds.size);
CGContextRef ref = UIGraphicsGetCurrentContext();
[_board.layer renderInContext:ref];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIImageWriteToSavedPhotosAlbum(img, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
}
#pragma mark 显示提示框
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
//创建alert
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"图片已保存到相册" message:nil preferredStyle:UIAlertControllerStyleAlert];
//创建action
UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil];
[alert addAction:action];
[self presentViewController:alert animated:YES completion:nil];
}