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
0
votes
1 answer

React-Native: How do I find file info for a ph:// uri?

I'm using the CameraRoll in React-Native 0.59.3 to fetch photos from the library. I get back the following information: height: 3024 isStored: true playableDuration: 0 uri: "ph://CC95F08C-88C3-4012-9D6D-64A413D254B3/L0/001" width: 4032 How do I…
Bill
  • 25,119
  • 8
  • 94
  • 125
0
votes
2 answers

Updating selected collectionview indexes after responding to PHPhotoLibraryChangeObserver event

I am making a multiple selection feature for my collection view which shows photos from the user's library. I keep track of the selected indexPaths in an array and I want to update them in case a photo library change observer event happens in the…
HemOdd
  • 697
  • 1
  • 7
  • 23
0
votes
1 answer

Disabling the auto request for Photo Library access

I am referring to this request: The first time your app uses PHAsset, PHCollection, PHAssetCollection, or PHCollectionList methods to fetch content from the library, or uses one of the methods listed in Applying Changes to the Photo Library to…
HemOdd
  • 697
  • 1
  • 7
  • 23
0
votes
0 answers

PhotoKit: How to remove source media file when user delete asset in Photos.app?

I have a problem with PhotoKit: In my app, i get a mp4 video from remote camera and save it to phone filesystem in documents folder. After this, I create an asset by using PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL:) and add it…
0
votes
1 answer

PHAssetResource.assetResources returns zero results with valid PHAsset

I'm trying to get the asset resources for a PHAsset and am having a little trouble. I'm able to fetch the PHAsset with no problems, yet the resources for the asset is always empty. This is not happening with every photo, but one in particular has…
Chris Mills
  • 89
  • 1
  • 6
0
votes
1 answer

Manage PHAssets

We have a very specific use case in the app I am working on where we need the following: Download PHAsset iCloud images and make sure data is cached on disk so next time it can be retrieved offline Create PHAsset from a file URL but do not show…
mdonati
  • 1,049
  • 11
  • 24
0
votes
1 answer

Performance for retrieving PHAssets with moments

I am currently building a gallery of user photos into an app. So far I simply listed all the user's photos in a UICollectionView. Now I would like to add moment clusters as sections, similar to the iOS Photos app. What I am doing (a bit…
BlackWolf
  • 5,239
  • 5
  • 33
  • 60
0
votes
1 answer

Synchronous method for accessing URL info for PHAsset objects

Are there any approaches for getting the URL of a PHAsset that does not involve asynchronous requests/processes? I realize that blocking the main thread when making requests like this is a no-no, but if you have a small number of assets to query, is…
AdjunctProfessorFalcon
  • 1,790
  • 6
  • 26
  • 62
0
votes
3 answers

How to delete an Album on iOS?

I'm using PhotoKit and I've created an album PHAssetCollectionChangeRequest.creationRequestForAssetCollection(withTitle: RooPhotoAlbum.albumName) But I found some issue with first time saving file to the album So I need to delete it so I could…
tianyu
  • 44
  • 4
0
votes
1 answer

How to load images and videos in same UICollectionView in iOS

I am trying to have one collection view which can show all images and videos from camera roll based on time stamp . i am able to load only images or only videos not both . i have tried below code var photos: PHFetchResult! // user…
Saket Kumar
  • 1,157
  • 2
  • 14
  • 30
0
votes
0 answers

PhotoKit delete photos,how to change the language of title?

I'm just use the PhotoKit to delete photos, just like this: [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ [PHAssetChangeRequest deleteAssets: arrayOfPHAssets]; } completionHandler:^(BOOL success, NSError *error) { NSLog(@"Finished…
lidechao
  • 3
  • 4
0
votes
1 answer

What is PHImageRequestOptionsResizeMode default value?

What happens if I don't specify any options in PHImageRequestOptions for resizeMode ? Will photos deliver the image size that I pass in targetSize or would it delivery exact image size ? Documentations seems is not clearing that part
mosn
  • 311
  • 3
  • 16
0
votes
1 answer

Swift 2.x to swift 3, XCode complaining : Cannot convert value of type PHFetchResult

Here is my code : var galleryController: GalleryController! var albums: PHFetchResult = PHFetchResult() var cameraRoll: [PHFetchResult] = [PHFetchResult]() albums=getAlbums() cameraRoll=getcameraRoll() func…
Zipette
  • 79
  • 7
0
votes
0 answers

iOS PHAssetResourceManager requestDataForAssetResource returns error in device but works in simulator

I have tried to use below API but get this error as below Error Domain=NSCocoaErrorDomain Code=-1 "(null)" - (PHAssetResourceDataRequestID)requestDataForAssetResource:(PHAssetResource *)resource …
Ekra
  • 3,241
  • 10
  • 41
  • 61
0
votes
3 answers

Photos not showing in collection view

When I open my application it asks me for permission to access my photos. That is all all right. But after accepting, the screen turns black and shows no photos and in my console it says that it has found no photos. Although I have photos on my…
Repaz Kung
  • 43
  • 1
  • 8