Created
May 21, 2015 23:11
-
-
Save sdgandhi/1b9649fb7256e06fad58 to your computer and use it in GitHub Desktop.
iOS — Save image to documents directory
This file contains hidden or 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
// Create path. | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:<#@"Image.png"#>]; | |
// Save image. | |
[UIImage<#PNG#>Representation(image) writeToFile:filePath atomically:<#YES#>]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment