Questions tagged [phasset]

A `PHAsset` is an object in the iOS Photos Framework (aka PhotoKit) that represents an image or video file on the iOS device.

A PHAsset object represents an image or video file that appears in the Apple Photos app, including iCloud Photos content.

To display or edit assets, use the PHAsset class to fetch asset objects for the photos or videos you want to work with. An asset object is immutable and contains only the metadata for the photo or video it represents.

For more detailed info: https://developer.apple.com/documentation/photokit/phasset

451 questions
0
votes
1 answer

Compiler error when using `enumerateObjectsUsingBlock` of PHFetchResult

I met the following compile error: Cannot invoke 'enumerateObjectsUsingBlock' with an argument list of type '((_, _, _) -> Void)' I think it may be easier to understand my situation with this screenshot of XCode6.3. This codes is for testing…
Kyokook Hwang
  • 2,682
  • 21
  • 36
0
votes
2 answers

Working with Photo Library: How do I add/retrieve a location per photo?

I'm trying to get the location of a photo via iOS 8's photo library. The doc says that the PHAsset class has a 'location' attribute. So I tried to view the 'location' via Xcode v6.3 attached to my iTouch running iOS 8.3... assessing my iTouch…
Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105
0
votes
1 answer

SDWebImage with PHAssets

i have an application where i am loading large amount of images from database and showing them in my gallery, what i was doing earlier is i was getting photo url (local identifier) from PHAsset and then accessing the image using PHCacheManager, but…
ash_win
  • 195
  • 2
  • 10
0
votes
1 answer

PhotoKit: includeAllBurstAssets in PHFetchOptions not working

I am trying to use the includeAllBurstAssets of PHFetchOptions. In my camera roll, there are about 5 burst assets (each with about 10 photos). To enumerate the assets in the Camera Roll I'm doing the following: PHFetchOptions *fetchOptions =…
holtmann
  • 6,043
  • 32
  • 44
0
votes
1 answer

How enumerate work when we get image from PHAsset.? (Swift)

I try to understand "enumerate" to get image from PHAsset. This is a sample code from a book (which allow any one to use). I added println to show the lines of what I though it would shown up as loop but surprised me it return result at the end.…
PKul
  • 1,691
  • 2
  • 21
  • 41
0
votes
1 answer

How do I fetch only certain PHCollections?

I've created three PHCollections within my app. In a different part of my app, I'm attempting to fetch them and display them in a table view. I can get all of the user created libraries by using the following code let topLevelUserCollections:…
user379468
  • 3,989
  • 10
  • 50
  • 68
0
votes
1 answer

Re-render video using the new Photos Framework in iOS8

I need to be able take a video from Photos and re-rendering, both clipping it in time, changing the width and height, and frame rate. Certainly I need to start with: PHContentEditingInputRequestOptions *options =…
Paul Cezanne
  • 8,629
  • 7
  • 59
  • 90
-1
votes
1 answer

Copy written billion+ pixel image to Photos?

My app is successfully writing multi-gigapixel images (many billions of pixels per image). Is there a way, without reading the image as a UIImage, to add or copy the saved image to Photos? It's difficult to search for the subject to find a solution…
Jeshua Lacock
  • 5,730
  • 1
  • 28
  • 58
-1
votes
1 answer

How to get image from library with URL in Swift?

I have an this URL file:///var/mobile/Media/DCIM/101APPLE/IMG_1426.JPG. How do I get image from library with it? I got that URL from the previous time run the app. Now I want to fetch only this image without fetching all image from library. I tried…
Ho Si Tuan
  • 520
  • 3
  • 13
-1
votes
1 answer

swift How to delete multiple PHAssets at once

I want to delete PHAssets at once. I wrote the code below, but it is deleted, but there is a problem that the number of alerts is selected. Couldn't the alert appear only once? @IBAction func deleteBtnAction(_ sender: Any) { for (key,…
장주명
  • 43
  • 6
-1
votes
2 answers

How do I get image file name from UIImagePickerController

I am trying to get file name from PHAsset reference provided by UIImagePickerController,How do I retrieve the image file name when choose from library and take photo with camera? I am using Xcode 11.4 and Swift 5.
Prabhakar
  • 15
  • 1
  • 3
-1
votes
1 answer

What's the key for sorting album with date of addition in iOS developer?

If sorting album with date of creation, I could give the key creationDate, so what's the key for date added? additionDate? No, it's incorrect. NSSortDescriptor(key: "creationDate", ascending: false)
Leo
  • 1,545
  • 13
  • 24
-1
votes
1 answer

Unexpectedly found nil while unwrapping an Optional value while fetching PHAsset Path

App crashes due to nil value in code on line : if let strURL = (contentEditingInput!.audiovisualAsset as? AVURLAsset)?.url.absoluteString Unexpectedly found nil while unwrapping an Optional value func getUrlFromPHAsset(asset: PHAsset, callBack:…
-1
votes
1 answer

Why app is blocked by semaphore?

I have the following function that suppose to return [CIImage] for my purpose - displaying some metadata of photos in tableView. func getCIImages() -> [CIImage] { var images = [CIImage]() let assets = PHAsset.fetchAssetsWithMediaType(.Image,…
Andrey M.
  • 3,021
  • 29
  • 42
-2
votes
1 answer

When to use PHAsset, PHCollection, PHAssetCollection, and PHCollectionList

I want to extract all photo albums from an iPhone. I am confused when to use and how to use PHAsset, PHCollection, PHAssetCollection, and PHCollectionList using objective C and the procedure to get all the album list with the photos. Any help…
Shashank Agarwal
  • 1,122
  • 1
  • 8
  • 24
1 2 3
30
31