Created
December 6, 2016 08:45
-
-
Save monsoir/e9f573bfa430bc56ae6b9b2e2aff8e6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Save Image to Photos, compatible with asynchronous callback | |
+ (void)saveImageToPhoto:(UIImage *)image completionTarget:(id)completionTarget completionSelector:(SEL)completionSelector contextInfo:(void *)contextInfo{ | |
if (completionTarget && [completionTarget respondsToSelector:completionSelector]) { | |
UIImageWriteToSavedPhotosAlbum(image, completionTarget, completionSelector, contextInfo); | |
} else { | |
#if DEBUG | |
NSLog(@"%s: completionTarget does not response to completionSelector.", __func__); | |
#endif | |
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment