Is it possible to save images captured by the camera on the iphone to a custom directory or somewhere on the iphone rather than saving to the camera roll?
I would like to save images to the device and then have access to the at a later stage, rather than reading from the camera roll using ALAssets.
Is this possible?
Move your photos and videos to cloud storage On your iPhone, open Settings. Tap [your name] > iCloud > Photos. Toggle the switch to turn on iCloud Photos. Tap Optimize iPhone Storage.
Everything stored in iCloud, including iCloud photos, is securely encrypted in transit and stored with encryption keys. Encryption keys are stored on Apple's servers. Without these encryption keys, files can not be decrypted. Apple also uses “end-to-end” encryption for data.
For a physical backup, go with a secure external drive If you want to store your photos physically, a secure external drive is a better choice. These devices tend to have higher storage capacity and faster speeds, plus they're harder to lose. They're also cheaper now than they were years ago.
Yes you can save them to your apps' documents folder. Here is an example:
// Create path
NSString *imagePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/ImageName.png"];
// Write image to PNG
[UIImagePNGRepresentation(image) writeToFile:imagePath atomically:YES];
To retrieve it:
UIImage *image = [UIImage imageWithContentsOfFile:imagePath];
To list all files in a directory:
NSFileManager *manager = [NSFileManager defaultManager];
NSArray *fileList = [manager directoryContentsAtPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]];
for (NSString *s in fileList){
NSLog(s);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With