I have a request, for a photo to be saved in an album with a file name.
I can't find a code online that I can refer to.
Send an image called "ABC.jpg" to the iPad via AirDrop on your Mac, On iPad, this image is exported as "ABC.jpg", not "IMG_xxx.jpg".
This means that the image can be named, is there a way to rename the image?
Thank you so much for your answer.
[[PHPhotoLibrary sharedPhotoLibrary] performChangesAndWait:^{
PHAssetCollection *assetCollection = [self customAlbumForTitle:self->albumFolderName];
PHAssetCollectionChangeRequest *assetCollectionChangRequest;
if (assetCollection) {
assetCollectionChangRequest = [PHAssetCollectionChangeRequest changeRequestForAssetCollection:assetCollection];
} else {
assetCollectionChangRequest = [PHAssetCollectionChangeRequest creationRequestForAssetCollectionWithTitle:self->albumFolderName];
}
PHAssetChangeRequest *assetChangeRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:theImage];
PHObjectPlaceholder *assetPlaceholder = [assetChangeRequest placeholderForCreatedAsset];
[assetCollectionChangRequest addAssets:@[assetPlaceholder]];
} error:&err];