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

442 questions
-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,…
장주명
  • 1
  • 2
-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
  • 2
-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,495
  • 12
  • 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.
  • 2,487
  • 20
  • 38
-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,112
  • 1
  • 7
  • 21
-3
votes
1 answer

Modify/Edit PhAsset Image by Cropping

is there any way to modify/edit phasset image by cropping or edited one? I have array of asset, I wanna crop image of asset by getting image from selected asset and passing it cropping controller and in return want to change that cropped image in…
1 2 3
29
30