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.

239 questions
52
votes
3 answers

Determine largest PHAsset image size available on iOS device

How can I determine the largest PHAsset image size that is available on an iOS device, where by "available" I mean currently on the device, not requiring any network download from iCloud Photo Library? I've been developing an app where a collection…
mluisbrown
  • 12,738
  • 6
  • 50
  • 81
30
votes
6 answers

Apple Live Photo file format

Apple will introduce Live Photo in iOS 9/iPhone 6s. Where is the file format documented?
Clay Bridges
  • 10,746
  • 10
  • 62
  • 110
22
votes
5 answers

How to identify if a PHAsset is not completely downloaded from iCloud (so I need to request again with options.networkAccessAllowed)

The docs say: PHImageResultIsInCloudKey: A Boolean value indicating whether the photo asset data is stored on the local device or must be downloaded from iCloud. (NSNumber) If YES, no image was provided, because the asset data must be…
Thyraz
  • 2,292
  • 2
  • 17
  • 21
21
votes
5 answers

How to get an ALAsset URL from a PHAsset?

You can do it sneakily† using the undocumented PHAsset.ALAssetURL property, but I'm looking for something documented. † In Objective-C, this will help @interface PHAsset (Sneaky) @property (nonatomic, readonly) NSURL *ALAssetURL; @end
Clay Bridges
  • 10,746
  • 10
  • 62
  • 110
19
votes
5 answers

Sorting photos exactly like native photoapp using PhotoKit

I am trying to reproduce the native iOS8 photopicker using Photos framework. I got a problem with the sorting. Lets say I do following: I edit a photo in Camera+ app and save it back to gallery. I favourite another photo. In the native…
knutigro
  • 1,014
  • 1
  • 9
  • 19
18
votes
2 answers

Which PHAssetCollection to use for saving an image?

In iOS 8's Photos.framework, I'm trying to save a UIImage to the user's photo library, much in the same way you can long-press an image in Safari and choose the "Save Image". In iOS 7, this would be by just calling ALAssetLibrary's…
Rizwan Sattar
  • 1,578
  • 1
  • 14
  • 21
17
votes
6 answers

CRASH attempt to delete and reload the same index path

CollectionViewController.m line 439 __50-[CollectionViewController photoLibraryDidChange:]_block_invoke Fatal Exception: NSInternalInconsistencyException attempt to delete and reload the same index path ( {length = 2, path = 0 - 26007}) -…
Ted
  • 19,425
  • 10
  • 78
  • 99
16
votes
2 answers

Fetch only photos of type PHAssetMediaTypeImage form asset collection type PHAssetCollectionTypeSmartAlbum

I am using the Photos framework to fetch album list in iOS8. I am able to do it using PHFetchResult *smartAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAlbumRegular…
bhoomi
  • 363
  • 1
  • 4
  • 11
14
votes
2 answers

Get URL of a newly created asset, iOS 9 style

ALAssetsLibrary is deprecated these days but practically all examples on SO are still making use of it. For my objective, I need to know the URL of the video that was added to the Photo Library so I could share a video to the Instagram app (that's…
Desmond Hume
  • 6,732
  • 13
  • 57
  • 104
13
votes
1 answer

Crash upon CGImageDestinationFinalize

My app allows users to edit photos using the Photos framework. I am seeing some crash reports, and it appears the crash occurs when generating the output image, but I am not sure where the problem lies. This crash is occurring on multiple hardware…
Jordan H
  • 45,794
  • 29
  • 162
  • 306
13
votes
4 answers

Save image to photo library using photo framework

My app crashes every time when I try to save image using photo framework. -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ _mChangeRequest = [PHAssetChangeRequest…
Shaik Riyaz
  • 10,085
  • 7
  • 48
  • 67
13
votes
1 answer

How to format NSPredicate for PHFetchOptions in Swift?

I cannot figure out the proper format necessary to define a predicate for an instance of PHFetchOptions. I've tried so many combinations but they either do not compile or no assets are returned. The goal is to get only the photos (no videos) in a…
Jordan H
  • 45,794
  • 29
  • 162
  • 306
13
votes
2 answers

How to get requested image size for iOS8 PhotoKit?

I am using the code below for fetching an image: [[PHImageManager defaultManager] requestImageForAsset:asset targetSize:CGSizeMake(800, 600) contentMode:PHImageContentModeAspectFill options:options resultHandler:^(UIImage *result, NSDictionary…
Unnati
  • 2,421
  • 15
  • 36
12
votes
1 answer

Metadata (EXIF, TIFF, etc.) in Photokit

In iOS 8, with the new PhotoKit, the way to create a new image is with -[PHPhotoLibrary performChanges:completionHandler], in this way: [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ PHAssetChangeRequest *changeRequest =…
Roadrunner-EX
  • 804
  • 10
  • 23
11
votes
0 answers

Can we access the new "Memories" feature via PhotoKit on iOS 11?

With iOS 11 Apple have introduces the amazing new memories feature to their photo app that intelligently pulls together photos into collections and assigns some super nifty metadata to them and their estimated importance to the user! I know that on…
George Green
  • 4,577
  • 5
  • 28
  • 45
1
2 3
15 16