Questions tagged [photokit]

PhotoKit (also known as Photos Framework) is a framework that allows you to retrieve assets for display and playback, edit their image or video content, or work with collections of assets such as albums, moments, and iCloud Shared Albums. This framework is available in iOS 8.0 and later.

PhotoKit (also known as Photos Framework) is a framework that allows you to retrieve assets for display and playback, edit their image or video content, or work with collections of assets such as user albums, smart albums and iCloud Shared Albums. This framework is available in iOS 8.0 and later.

256 questions
6
votes
0 answers

why is PHPhotoLibrary performChanges creationRequestForAssetFromVideoAtFileURL so slow?

I'm measuring times from tens of seconds to minutes depending on the size of the video. Shouldn't this change request be fast (local flash disk copy/meta data/checksums) as it adds a local video to the photolibrary/camera roll? This issue appears to…
Mark Essel
  • 4,606
  • 2
  • 29
  • 47
6
votes
4 answers

PHFetchOptions for PHAsset in same sort order as Photos.app

I'm using the new PHFetchOptions' sortDescriptors for getting PHAssets from the camera roll. There seem to only be two keys to sort on: creationDate and modificationDate, neither of which are the same as what you see in the Photos.app. Am I missing…
Art C
  • 842
  • 2
  • 10
  • 21
6
votes
2 answers

Loading of images from Photos to collection view results in error message "Connection to assetsd was interrupted or assetsd died"

I am trying to load all the images from the user's Photo album into my app's Collection View but after a loading a few of them, the app will close itself and return back to the main menu. The connection with XCode is also disconnected. This does not…
winhung
  • 553
  • 1
  • 5
  • 19
6
votes
2 answers

PHPhotoLibrary error while saving image at url

I create an image at url provided by PHContentEditingOutput. When I load data to UIImage and save it like this - it works. [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ NSData *data = [NSData…
Tomasz Bąk
  • 6,124
  • 3
  • 34
  • 48
6
votes
4 answers

How to know if a PHAsset has been modified?

More specifically, how can you know whether a PHAsset has current version of the underlying asset different than the original? My user should only need to choose between the current or original asset when necessary. And then I need their answer for…
Tomasz Bąk
  • 6,124
  • 3
  • 34
  • 48
5
votes
0 answers

Apple PhotoKit API - access to faces/people

Currently does the PhotoKit API allow access to the People album & the face information or is all that private? For example is it possible to fetch all of the photos of "John Smith" if I have him tagged in my library and then access the facial…
adamteale
  • 940
  • 2
  • 12
  • 27
5
votes
0 answers

What is CloudPhotoLibraryErrorDomain Code=25?

We are trying to download assets from iCloud using PHCachingImageManager: requestImageDataForAsset: options: resultHandler, however we encounter the following error on production: Domain=CloudPhotoLibraryErrorDomain Code=25 “Record the_record_id…
Amir Aharon
  • 291
  • 2
  • 9
5
votes
5 answers

Issue playing slow-mo AVAsset in AVPlayer

I'm trying to play an slow motion video (filmed by the user's iPhone) in an AVPlayer. I am retrieving the AVAsset with a request on a PHAsset from a picker: [manager requestAVAssetForVideo:PHAsset …
user339946
  • 5,961
  • 9
  • 52
  • 97
5
votes
0 answers

Edit Exif Data in iOS Photos Gallery/ LIbrary without Creating Another Copy

Is there a way to edit/ modify the exif data of the photot that are part of iOS photo library / gallery on the iPhone. Whenever I try to do that, iOS tries to save it as a separate image file. However, I would like to modify the exif data, without…
exifguy
  • 650
  • 7
  • 16
5
votes
2 answers

Fetch only albums in a PHCollectionList

A PHCollectionList is a folder that could contain any number of albums and/or folders. I am currently fetching the collections within the list via PHCollection.fetchCollectionsInCollectionList(list, options: nil). This could return objects of type…
Jordan H
  • 52,571
  • 37
  • 201
  • 351
5
votes
2 answers

PhotoKit: fetchAssetCollectionsWithLocalIdentifiers fails

The following code highlights the issue in 3 simple steps: 1) fetch moments 2) cache moment localIdentifier 3) fetch moment with identifier : fail( on device, iOS 8.2 ) - ( void )momentLocalIdTest { PHFetchResult * fetchResult; …
Gregzo
  • 1,194
  • 7
  • 18
5
votes
1 answer

How to know if an PHAssetCollection is the recently deleted collection?

There is a subtype for the recently added collection: PHAssetCollectionSubtypeSmartAlbumRecentlyAdded. However there is no assetCollectionSubtype that would identify the "Recently Deleted" collection. This is the description of the "Recently…
JensD
  • 253
  • 2
  • 9
5
votes
2 answers

PHImageManager crashing after many image requests

I'm trying to grab all of the users PHAsset with PHAssetMediaTypeImage and then iterate through them, getting the corresponding UIImages one at a time. I have about 2k photos on my iPhone 5 and this code crashes after iterating through 587 of them.…
4
votes
1 answer

Get PHAsset/localIdentifier of image saved to photo library

I'm using UIImageWriteToSavedPhotosAlbum to save images to the Photos app. This was the only function I found that lets you do this. Here's my code: import UIKit import Photos class ViewController: UIViewController { /// photo of a cactus …
aheze
  • 24,434
  • 8
  • 68
  • 125
4
votes
1 answer

Convert a video into an IOS Live Photo format without an Apple device

I'm currently making live/animated wallpapers for Android phones, which is pretty easy with GIF/Mp4 files. But I would also like to make the live wallpapers compatible natively with ios/iPhones. I've seen many tutorials on how to convert a video to…
Yokiie
  • 41
  • 2