The PHPhotoLibrary framework provides interfaces for viewing, editing and creating assets and collections managed by the IOS Photos app.
Questions tagged [phphotolibrary]
196 questions
109
votes
12 answers
Determine if the access to photo library is set or not - PHPhotoLibrary
With the new functionality in iOS 8, if you are using a camera in the app, it will ask for permission to access the camera and then when you try to retake the pic, it asks for permission to access photo library. Next time when I launch the app, I…

tech_human
- 6,592
- 16
- 65
- 107
33
votes
3 answers
PHPhotoLibrary crashed when getting placeholderForCreatedAsset
I try to put image to custom album with this code:
PHAssetCollection *album = [self getMyAlbum];
UIImage *image = [self getMyImage];
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
PHAssetChangeRequest *createAssetRequest =…

Ancle
- 465
- 4
- 11
19
votes
6 answers
How to get the URL of an image just added in PHPhotoLibrary
I am using the UIImagePickerController in two cases
to select an existing image in the Photo Library
to take a new picture
In the first case, when I choose an image form the library, I can easily get the URL in the delegate method:
- (void)…

PatrickV
- 1,090
- 2
- 9
- 23
13
votes
2 answers
Detect add photos only permission
In ios 11 we now have "Add photos only" permission setting.
But how we now determinate which photo library access level is set?
[PHPhotoLibrary authorizationStatus] works only for "Read and Write" permission check. If app asked only for "Add photos…

Edgar Jan
- 175
- 2
- 9
13
votes
2 answers
Error Domain=NSCocoaErrorDomain Code=-1 "(null)" when moving .mov to camera roll
I'm having a weird problem moving a .mov file created by my app from the documents folder to the camera roll. A bit of background:
The app makes time lapse movies. It works specifically with the devices that have a 12 megapixel 4032x3024 sensor. It…

FishTales
- 235
- 3
- 7
11
votes
2 answers
xcode 8 PHPhotoLibrary.requestAuthorization causing crash
My app keeps crashing when running in the simulator everytime I try to request authorization for the photo library. I am using the following code in my appDelegate in didFinishLaunchingWithOptions:
if PHPhotoLibrary.authorizationStatus() !=…

alionthego
- 8,508
- 9
- 52
- 125
11
votes
1 answer
How to detect Photo Library changes when app was terminated and now restarted?
Using the new Photos Framework, I am able to detect changes to the photo library when the app is running and in the background using photoLibraryDidChange.
But when the app is terminated (either by the user or by the system), how can i detect the…

claramelon
- 141
- 1
- 8
10
votes
4 answers
`PHAssetChangeRequest.creationRequestForAssetFromVideo(url:)` fails for high FPS videos on iPhone SE
We have gotten reports of issues with recording slow motion videos in our application. We have tested the issue on iPhone X, iPhone 6, and iPhone SE. The 6 and the X both work fine, but the SE fails when attempting to add the recorded video to…

Oyvindkg
- 111
- 10
10
votes
2 answers
PHAssetChangeRequest failing for UIImage taken with camera
I'm having an issue implementing a camera View Controller for an iOS app that I'm working on. When a button is pressed, I have a singleton camera object that manages the AVFoundation side of things and captures the image. As you can see below,…

C. Feenstra
- 593
- 3
- 11
9
votes
1 answer
Disable confirmation on delete request in PHPhotoLibrary
What I am trying to do is to save videos to PHPhotoLibrary, and then remove them when upload to clients remote server in the application completes (basically, photo library serves as temporary storage to add additional layer of security in case…

Jiri Trecak
- 5,092
- 26
- 37
8
votes
2 answers
Getting size (height and width) from PHAsset
Is there a way to get the height and width of the image from a PHAsset object.
I'm trying to make an image picker with a custom UICollectionViewLayout (Kind of like the main page of Pinterest app) I'v fetched all of the photos from the photo library…

Abbin Varghese
- 129
- 1
- 5
8
votes
0 answers
Exception in saving a lot of files with PHPhotoLibrary API
My application has function to downloads many photo and video files in tmp folder and save them in camera roll with PHPhotoLibrary API.
The problem is that sometimes (the probability is around 10%) exception happens in the saving process.
The error…

M.Masa
- 532
- 4
- 20
8
votes
2 answers
How to get images from Custom album of Photos, iOS SDK?
I'm working on an iOS app in which I need gallery view like Instagram. I have added gallery View, camera View and video View, after taking image it saves to custom album of Photos. Now I want to retrieve those images from custom album and show it to…

hmjha
- 491
- 2
- 6
- 18
8
votes
2 answers
Get PHAsset from iOS Share Extension
I am developing a share extension for photos for my iOS app. Inside the extension, I am able to successfully retrieve the UIImage object from the NSItemProvider.
However, I would like to be able to share the image with my container app, without…

haplo1384
- 1,206
- 1
- 12
- 29
8
votes
1 answer
PHChange changeDetailsForFetchResult - always returns nil
I am using the PHPhotoLibrary to retrieve several photo collections like this:
_smartAlbumsFetchResult = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAlbumMyPhotoStream…

Sebastian Krogull
- 1,468
- 1
- 15
- 31