Questions tagged [phphotolibrary]

The PHPhotoLibrary framework provides interfaces for viewing, editing and creating assets and collections managed by the IOS Photos app.

196 questions
5
votes
3 answers

PHPhotoLibrary get album names

I've been trying to find an alternative for getting the album names with the Photos API in iOS 8. With ALAssets, we can use: valueForProperty:ALAssetsGroupPropertyName however with the Photos API, I can't seem to find an alternative. There is:…
klcjr89
  • 5,862
  • 10
  • 58
  • 91
4
votes
1 answer

Photo save fails with Error Domain=PHPhotosErrorDomain Code=3302

When trying to save screen recording file to my device like: PHPhotoLibrary.shared().performChanges({() -> Void in PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: url) }, completionHandler: { (_,…
user16525780
  • 319
  • 1
  • 4
  • 11
4
votes
1 answer

How to filter the images shown on the PHPickerViewController to those selected for limited access

How do I filter the images shown on the PHPickerViewController to those that have been selected under limited access by the user? Or do I need to use a different picker? I've been struggling with this for a few days now. Any help would be…
Quailcreek
  • 125
  • 2
  • 9
4
votes
1 answer

PHPickerViewController load videos via PHAsset

PHPickerViewController allows access to copies of photo library assets as well as returning PHAssets in the results. To get PHAssets instead of file copies, I do: let photolibrary = PHPhotoLibrary.shared() var configuration =…
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131
4
votes
3 answers

The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data

I have added NSPhotoLibraryAddUsageDescription as well as NSPhotoLibraryUsageDescription in info.plist file of my project. While trying to create album or add image to photo library following error is coming This app has crashed because it attempted…
Afsar edrisy
  • 1,985
  • 12
  • 28
4
votes
0 answers

How to observe photo library changes even when app is closed?

I need to be notified when a photo/video is taken, even when my app is closed. Does anybody know how apps like Google Photos achieve this in iOS? So far, I have implemented and registered PHPhotoLibraryChangeObserver however photoLibraryDidChange…
4
votes
2 answers

Get the same NSData of PHAsset after save

Do you know is there any way to get the same NSData of Image ( JPG , PNG ) after save with PHPhotoLibrary or no? OfC, iOS will modify some metadata and EXIF-- > ( Timestamp,... )data after save but, I'm asking about UIImage Data (include same EXIF…
Mo Farhand
  • 1,144
  • 8
  • 21
4
votes
0 answers

How to retrieve all images from photo library using photos framework in mac using swift?

I am trying to retrieve images from photo library using swift. This is the below code that is working for iOS: func fetchPHAssets() -> [PHAsset] { var assets = [PHAsset]() let options = PHFetchOptions.init() options.predicate =…
user4150758
  • 384
  • 4
  • 17
4
votes
0 answers

iOS - PhotosKit - Troubles identifying modified assets

I'm working with the Photos framework, specifically I'd like to keep track of the current camera roll status, thus updating it every time assets are added, deleted or modified (mainly when a picture is edited by the user - e.g a filter is added,…
Eil88
  • 121
  • 5
4
votes
0 answers

Unit Test PHFetchResult

I am trying to unit test retrieving assetCollection and assets. In order to be allowed to access my PhotoAlbums I have to grant permissions. This normally either happens during the first call of a function like fetchAssetCollections or manually by…
3vangelos
  • 501
  • 8
  • 15
4
votes
0 answers

How to save GIFs with the PHPhotoLibrary?

I have an app that displays GIFs from the internet and I am trying to add the ability to save a GIF to the camera roll. I am using the PHPhotoLibrary and I was trying to save it to the camera roll using the method I've seen in several SO questions…
NewShelbyWoo
  • 722
  • 1
  • 7
  • 21
4
votes
1 answer

How to use PHPhotoLibrary in a mixed code Objective-C/C++ file (a .mm file)?

I am trying to use the PHPhotoLibrary class in an iOS project, but need it in one of my mixed code Objective-C/C++ files. I am getting a build error bc apparently the needed import is not correct. The Apple docs here clearly show that @import…
Alyoshak
  • 2,696
  • 10
  • 43
  • 70
4
votes
1 answer

Accessing PHPhotoLibrary while app is in the background

I have a NSURLDownloadTask which is successfully downloading files in the background (large image or video files). And I successfully copy url's and call this function to save my url to photo library. As you can see, I would like to send a…
NSGangster
  • 2,397
  • 12
  • 22
4
votes
1 answer

Add new Asset to a new Asset Collection within one Change Block

After looking into the PHPhotoLibrary Framework, I've been able to successfully create and add new image assets and collections but the issue I've run into is not being able to successfully create a new Asset Collection AND add a new Asset to in…
Ohifriend
  • 352
  • 4
  • 10
4
votes
1 answer

How can I edit or rename a PHAssetCollection LocalizedTitle?

I want to change the albumName in my app. if ([collection canPerformEditOperation:PHCollectionEditOperationRename] == YES) { //rename localizedTitle } If that is "YES", I want to change the name. My code is: PHFetchOptions…
GioHong
  • 51
  • 4
1 2
3
13 14