iOS11 需要添加
Privacy - photo LIbrary Additions Usage Description 添加到相册。
- (void)saveTophone:(UIImage *)image {
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), (__bridge void *)self);
}
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
NSLog(@"image = %@, error = %@, contextInfo = %@", image, error, contextInfo);
}