The PHPhotoLibrary framework provides interfaces for viewing, editing and creating assets and collections managed by the IOS Photos app.
Questions tagged [phphotolibrary]
196 questions
2
votes
1 answer
Disable confirmation on delete request in PHPhotoLibrary delete Assets?
My question is how can I disable confirmation on delete request on [PHAssetChangeRequest deleteAssets:assets], if my application created that assets , so my app should able to delete assets without confirmation?
[[PHPhotoLibrary…

Musthafa
- 862
- 3
- 12
- 27
2
votes
2 answers
Save image to custom galary folder using phphotolibraty - iOS
I am using following code to save image to my custom folder created in iOS photo gallery:
I get this error: Error Domain=NSCocoaErrorDomain Code=-1 "(null)"
Can anyone help me out on this ?
+(BOOL)saveToAlbum:(NSString*)albumName…

Saurabh Bisht
- 389
- 1
- 13
2
votes
1 answer
Photos API convert PHFetchResultChangeDetails indexes to NSMutableOrderedSet
I'm having a problem trying to change my data source after a PHChange event occurs. I'm using an NSMutableOrderedSet as my data source type. When a PHChange happens, it can give you back three possible indexes: removedIndexes, insertedIndexes, and…

klcjr89
- 5,862
- 10
- 58
- 91
1
vote
0 answers
How to store the PHPersistentChangeToken?
I just can't use NSUserDefault to store it:
UserDefaults.standard.set(PHPhotoLibrary.shared().currentChangeToken, forKey: "token")
Here is the error:
[User Defaults] Attempt to set a non-property-list object

DNB5brims
- 29,344
- 50
- 131
- 195
1
vote
0 answers
How do I maintain transparency when loading WebP format images on iOS?
I have a function to import images from an array of NSItemProvider (passed from a PHPickerViewController) and I need to maintain transparency in the images. Any images in PNG format are correctly maintaining transparency but WebP images are not. The…

stackunderflow
- 754
- 7
- 18
1
vote
1 answer
Image gallery not show after request access permission
i try to show image gallery after user permission to allow all photos, but the gallery is not showing. but when i back to previous controller and navigate back, the gallery show up. but that's not what i want, i want after user allow the image show…

ferryawijayanto
- 569
- 4
- 18
1
vote
1 answer
How to present PHPhotoPicker which contains only photos user gave permission to use in Swift?
Since iOS 14 there is a new API for photo selection called PHPhotoPicker. Alongside that, newly feature has been added and it allows users to give permission for only selected photos to be accessed by the iOS app.
Considering that, I want to be able…

cXode
- 29
- 7
1
vote
0 answers
Video save error in iPhone Gallery for H265 Codec
I am using an app in which I am creating a video from my live stream and convert it to Mp4/Mov format and save it to documents directory.
I am using below command to create Mp4 file from video frames.
-loglevel trace -r 20 -i inputfile -c:v copy -f…

Manthan
- 3,856
- 1
- 27
- 58
1
vote
1 answer
Export of Video file using PHImageManager fails:AVFoundationErrorDomain Code=-11800 "The operation could not be completed" Code=-12212
I am trying to export a video asset from camera roll on a simulator using PHImageManager from the Photos iOS SDK. When the export completion block executes, it results in this error:
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation…

Weston Mitchell
- 192
- 1
- 12
1
vote
1 answer
"The file couldn’t be opened because you don’t have permission to view it." for iCloud Videos
it has been a couple of days, I am struggling with this issue. I am taking a video from photo library and using it to create a thumbnail image. My code is working properly and I am getting the video data and thumbnail for local videos.
But when I…

John Xavier
- 73
- 1
- 12
1
vote
0 answers
When video url save in gallery show error : Domain=NSCocoaErrorDomain Code=-1 "(null)" in swift
-When save video url in gallery
-I also set read and write permission.
error : Domain=NSCocoaErrorDomain Code=-1 "(null)" in swift.
private func saveVideoToPhotos(url : URL?) {
if let url = url, let urlData = NSData(contentsOf: url) {
…

Vrushabh Dhameliya
- 11
- 1
- 3
1
vote
0 answers
Inserting slowMo AVComposition into AVMutableComposition
PHPhotoLibrary gives an AVComposition rather than an AVURLAsset for a video recorded in SlowMo. I want to insert slowMo videos into another AVMutableComposition, so this means I need to insert this AVComposition into AVMutableComposition which is my…

Deepak Sharma
- 5,577
- 7
- 55
- 131
1
vote
1 answer
Saving CIImage with Depth data with writeJPEGRepresentation function
I have a portrait image with depth data with it and after some processing, I want to save a copy of it to a user photo album with depth data preserved (UIImage not an option in this case). For this task, I am using the function…

eral
- 123
- 1
- 16
1
vote
2 answers
Retrieving Video Asset After Saving it to Gallery
I am trying to save a video to Gallery and after that retrieving the asset, in ios 12 it worked fine, now testing it in ios 13 is not working anymore. The video is correctly saved, but the asset retrieved is not the correct one, instead, it is…

David Vittori
- 1,146
- 1
- 13
- 30
1
vote
1 answer
How to share UIImage to Camera Roll using UIActivityViewController
I wrote this code to share UIImage
guard let codeImage = imgQRCode.image else {
return
}
PHPhotoLibrary.requestAuthorization({status in
if status == .authorized {
let ac = UIActivityViewController(activityItems:…

Dawy
- 770
- 6
- 23