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
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
  • 8
11
votes
3 answers

How to fetch album poster image using Photo Kit?

When using Assets Library you could fetch the album's poster image from ALAssetsGroup. How do you achieve the same when using Photos Framework (Photo kit)?
bhoomi
  • 363
  • 1
  • 4
  • 11
11
votes
3 answers

How do I determine if a PHAsset in a PHFetchResult represents a deleted photo?

I'm trying to grab a thumbnail of the last photo taken on a device using the new Photos framework in iOS 8. The code I have right now to do this is the following: PHFetchOptions *fetchOptions = [PHFetchOptions new]; fetchOptions.sortDescriptors =…
Ziewvater
  • 1,331
  • 1
  • 16
  • 33
10
votes
1 answer

Search iOS photos by keyword?

Apple's Photos app allows users to query photos with search keywords like "surfing", "food", "sky". How could a third-party iOS app with Camera and Photos permissions search the phone's camera roll using arbitrary strings? Searching for Photos is…
sgarza62
  • 5,070
  • 5
  • 37
  • 59
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
3 answers

Programmatic access to the Photos Library on Mac OS X: PhotoKit / Photos Framework for Mac

In Objective-C, there's a Photos Framework a.k.a. PhotoKit which enables iOS developers to access the photos library on iPhone and iPad and to retrieve the pictures/videos along with their metadata. How would Mac developers perform a similar task?…
Pierre F
  • 1,204
  • 12
  • 28
10
votes
1 answer

iOS 8, PhotoKit, PHAsset, unique identifier

Working on an app that is iOS 8, and handles a lot of photos, I need to uniquely identify PHassets but cannot find any property to use? I found one property on PHObject/localIdentifier documented here…
Huang
  • 1,345
  • 2
  • 11
  • 27
10
votes
2 answers

Retrieve ALAsset or PHAsset from file URL

Selecting images in Photos.app to pass to an action extension seems to yield paths to images on disk (e.g.: file:///var/mobile/Media/DCIM/109APPLE/IMG_9417.JPG). Is there a way to get the corresponding ALAsset or PHAsset? The URL looks like it…
Duc
  • 477
  • 1
  • 8
  • 14
10
votes
3 answers

How can I determine file size on disk of a video PHAsset in iOS8

I can request a video PHAsset using the Photos framework in iOS8. I'd like to know how big the file is on disk. There doesn't seem to be a property of PHAsset to determine that. Does anyone have a solution? (Using Photos framework not required)
jlw
  • 3,038
  • 1
  • 16
  • 23
9
votes
2 answers

Photokit preserve user album list order

Is there any way to preserve the list order a user has arranged all of their albums in the Photos app? I've been trying to fix this all day, and I can't seem to figure out what I'm missing to preserve the order for displaying in my app. I would…
klcjr89
  • 5,662
  • 9
  • 54
  • 91
9
votes
1 answer

Upload videos from gallery using Photos framework

What is the best way to upload videos from gallery using Photos framework? Before I used ALAssetRepresentation and next method: - (NSUInteger)getBytes:(uint8_t *)buffer fromOffset:(long long)offset length:(NSUInteger)length error:(NSError…
f3n1kc
  • 2,077
  • 17
  • 18
9
votes
0 answers

How to determine if iCloud Photo Library is enabled?

I would like to modify my app's behavior based on whether or not iCloud Photo Library is enabled or disabled. How does one determine that status? And is there a way to subscribe to a notification such that if the user changes that setting my app…
Jordan H
  • 45,794
  • 29
  • 162
  • 306
8
votes
1 answer

Modifing metadata from existing phAsset seems not working

In my App I want to make it possible, that the user sets an StarRating from 0 to 5 for any Image he has in his PhotoLibrary. My research shows, that there are a couple of ways to get this done: Save the exif metadata using the new…
Marcel T
  • 599
  • 1
  • 4
  • 28
8
votes
2 answers

Does PHImageManager return images in pixel or point size for 2x and 3x screens?

I'm loading images from the camera roll via PHImageManager, but the returned images are not retina resolution. Do I have to provide a multiplier myself for 2x and 3x or do I have something wrong? Here is my code: class ReviewableImageView:…
eddit
  • 133
  • 5
8
votes
0 answers

Can you get the photos in "Recently Deleted" using PhotoKit?

I've scanned the API and found nothing so far. I'd take a PHAssetCollection for "Recently Deleted", or a way to fetch the individual PHAssets. I'm not recommending (or disrecommending), but there are some solutions outside the API, and yet possibly…
Clay Bridges
  • 10,746
  • 10
  • 62
  • 110
1
2
3
15 16