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
1
vote
1 answer

How to resolve the PhotoKit error "Original resource choice is only valid for an unadjusted base version"?

I try to add IPTC, TIFF and EXIF data to an PHAsset. When I apply changes with the following code snipped I got the mentioned error: guard let ciImage = CIImage(contentsOf: input.fullSizeImageURL!, options: [.applyOrientationProperty:true]) else { …
sn3ek
  • 1,929
  • 3
  • 22
  • 32
1
vote
1 answer

Share PHAsset stored in camera roll using UIActivityViewController

I'm storing images and videos in a Camera Roll album using PhotoKit, and want to allow the user to share them using UIActivityViewController. If I pass UIActivityViewController a UIImage instance, it works as expected, probably because the image…
Ian
  • 2,078
  • 1
  • 17
  • 27
1
vote
2 answers

Creating Subfolder inside a folder using PhotoKit

I understand how one can create a folder programmatically using Apple's PhotoKit API and add Photos to the folder. PHPhotoLibrary.shared().performChanges({ let req =…
1
vote
2 answers

App crashed when i select a photo from iCloud

I am trying to fetch all photos from my device, and show them in a collection: var allPhotos : PHFetchResult? = nil PHPhotoLibrary.requestAuthorization { status in switch status { case .authorized: let fetchOptions =…
Amalendu Kar
  • 458
  • 1
  • 6
  • 17
1
vote
0 answers

cocoa access to PHContentEditingInput.fullSizeImageURL?

The official Apple documentation for PHContentEditingInput.fullSizeImageURL says this is available in macOS 10.11+, however Xcode doesn't think so. Curiously Step 2 to get the PHContentEditingInput is via the requestContentEditingInput method which…
Stickley
  • 4,561
  • 3
  • 30
  • 29
1
vote
0 answers

PHAsset url returns nil image

Problem: Loading an UIImage with an url obtained from PHAsset returns nil. Context: I have a UI component which works with image URLs and is populated in different parts of the app with different providers. In a specific case I receive PHAsset. Code…
Fawkes
  • 3,831
  • 3
  • 22
  • 37
1
vote
0 answers

PHAsset paginated fetching

Is there a way to load PHAssets by pagination? Below is the code to fetch photos stored on my device (it takes too much time to check for availability of photo on my phone). Hence i need an efficient way to load assets. func getOption() ->…
1
vote
0 answers

Get photos that contains disparity data in iOS11 from PhotoKit

I want to get the user photos that contains disparity data, my first thought was to use the smart album .smartAlbumDepthEffect but since Portrait Mode photos taken in iOS 10 doesn't have disparity data that won't work. Is there a way to query…
Jimmy
  • 10,427
  • 18
  • 67
  • 122
1
vote
1 answer

Modifying Metadata from PHAsset with mediaType Video fails

I try adding/modifying the Metadata from an PHAsset with mediaType == .video I found some Questions refering to a similar problem: How to change video metadata using AVAssetWriter? Add custom metadata to video using AVFoundation Regarding to the…
Marcel T
  • 659
  • 1
  • 7
  • 28
1
vote
1 answer

PHAssetCreationRequest supportsAssetResourceTypes

I tried to write a live photo to album. It always failed. So I tested on my iPhone7, I found BOOL s = [PHAssetCreationRequest supportsAssetResourceTypes:[NSArray arrayWithObjects:[NSNumber numberWithInteger:PHAssetResourceTypePairedVideo],…
user862639
  • 21
  • 1
  • 3
1
vote
1 answer

iOS - Cast video to Chromecast using PhotoKit

I want to cast device local video to Chromecast using PhotoKit framework but only loading screen is displayed on Chromecast and no video is played. If replace avUrlAsset.url.absoluteString with http_url_of_video than it play the video successfully.…
Kirit Vaghela
  • 12,572
  • 4
  • 76
  • 80
1
vote
1 answer

iOS8 PhotoKit, some albums can't be finded

When I used PhotoKit to create my albums,there is not all albums in my project,some albums imported from computer can't be searched.I will post my code follow. //get system albums PHImageRequestOptions * options = [[PHImageRequestOptions alloc]…
Kevin.Wei
  • 29
  • 6
1
vote
2 answers

PHFetchResult custom sorting: items ordered by day, oldest photos first

I am willing to order my results by day so that the oldest photos are displayed on top. I am currently fetching photos using the PHAsset fetchAssetsWithMediaType: @property PHFetchResult *photos; self.photos = [PHAsset…
Niko Zarzani
  • 1,372
  • 2
  • 15
  • 28
1
vote
0 answers

PhotoKit - didFinishPickingMediaWithInfo vs creationRequestForAssetFromImage (data not equal??)

Wanted to get some feedback to see what I might be missing here. Basically I use a UIImagePickerViewController to take a photo. When I am done i retrieve this image like this: UIImage *photoTaken = [info…
cspam
  • 2,911
  • 2
  • 23
  • 41
1
vote
2 answers

App crashes when I call requestImage

My app crashes with error Thread 1: EXC_BAD_INSTRUCTION when this method is called: imageManager.requestImage(for: asset!, targetSize: CGSize(width:100,height:100), contentMode: .aspectFit, options: options, resultHandler: {(image,info) -> Void…
random_0620
  • 1,636
  • 5
  • 23
  • 44