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
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
  • 824
  • 11
  • 23
12
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,413
  • 1
  • 18
  • 33
11
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,332
  • 15
  • 33
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
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,807
  • 5
  • 31
  • 45
10
votes
2 answers

Is there a way to save a Live Photo to the Photo Library?

I'm passing stored image and video files to: PHLivePhoto.requestLivePhotoWithResourceFileURLs and getting a PHLivePhoto object that I can display in PHLivePhotoView. But I am wondering, once I have a PHLivePhoto is there a way to save it to the…
keegan3d
  • 10,357
  • 9
  • 53
  • 77
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,355
  • 2
  • 11
  • 28
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
  • 487
  • 1
  • 7
  • 15
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,166
  • 1
  • 19
  • 24
9
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
  • 143
  • 6
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,862
  • 10
  • 58
  • 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,087
  • 18
  • 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
  • 52,571
  • 37
  • 201
  • 351
8
votes
3 answers

iOS PHImageManager.default().requestImage callback is called twice for the same image

When I try to get an image with specific size, PHImageManager.default().requestImage is called twice with images of different sizes. Here is the code: static func load(from asset: PHAsset, targetSize: CGSize? = nil, completion: @escaping…
Semyon Tikhonenko
  • 3,872
  • 6
  • 36
  • 61
1
2
3
17 18