How to save a UIImage

- by
    // let's save our image as a JPG
    NSData *imageData = UIImageJPEGRepresentation(chosenImage, 1);
    
    // get our home directory and add the save path and file name
    NSString *imagePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/myImage.jpg"];
    
    // then write the file to disk
    [imageData writeToFile:imagePath atomically:YES];


If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.