Questions tagged [phassetcollection]

31 questions
2
votes
0 answers

Move PHAsset from one Album to Another (Swift)

I want to move a PHAsset from one Album to another album. Here is what I am doing: func saveImage(image: UIImage, album: PhotoAlbum, completion: (PHFetchResult?)->()) { var placeholder: PHObjectPlaceholder? …
Sohil R. Memon
  • 9,404
  • 1
  • 31
  • 57
1
vote
1 answer

Swift: how to fetch all photos (PHAsset) except Screenshots, Burst, Live?

I want to fetch all photos (PHAsset) except Screenshots, Burst, Live photos from Photo library. I tried with code below but it returns Screenshots, Burst, Live photos let options = PHFetchOptions() options.sortDescriptors = […
1
vote
1 answer

How to fetch "Camera Roll", "Videos", "Favorites", "Selfies" and "Screenshots" in fetch PHAssetCollection statement - swift 4

I am working with Photo framework and try to fetch all photos & videos in all albums on iPhone. But the problem is I can't fetch all albums including "Camera Roll", "Videos", "Favorites", "Selfies", "Screenshots" and others albums with the…
ANDYNVT
  • 531
  • 4
  • 19
1
vote
1 answer

Get Specific Photo from Specific Photo Album with PHAssetCollection in Swift 4

I am storing the photo with the use of following code. But now I have to get the photos from storage using name. First Question: How can I store the photos using name ? Should I store it in Core Data ? Second Question: How can I get that photo…
Ali Ihsan URAL
  • 1,894
  • 1
  • 20
  • 43
1
vote
1 answer

Exclude iCloud shared albums with fetching asset collections

I'm trying to fetch a list of all the albums in the user's photo library excluding any iCloud shared albums. Here is the code I am using so far: PHFetchOptions *userAlbumsOptions = [PHFetchOptions new]; userAlbumsOptions.predicate = [NSPredicate…
mashers
  • 1,009
  • 7
  • 22
1
vote
0 answers

Fetch Videos from Video App

Need some support in fetching videos which are available in default videos app. I tried with PHAssetCollection & UIImagePickerControler it din't work as excepted. UIImagePickerController *mediaUI = [[UIImagePickerController alloc] init]; …
0
votes
2 answers

How to get uiCollectionView original asset or image when selected and how to pass it back to previous viewcontroller and load to imageView

I have a collection view to feed one imageView on the main viewController. I have three problems: 1-I am forced to use "highQualityFormat"in collectionView because I can not get the original image on didSeleect function.is there any way to get the…
farzad
  • 3
  • 3
0
votes
1 answer

get Image from PHAsset issue to detect updates on images

I'm currently managing a PHAsset with multiple Pictures (from an Album my application is creating), I'm able to display it without any problem. For each picture of my PHAsset, I'm calculating the hash of each pictures in my app. But If I'm modifying…
tiamat
  • 879
  • 2
  • 12
  • 35
0
votes
1 answer

How can we know if image already exists in the album?

I have created an album programmatically. I want to check if image already exists in album before adding new image. you can check with below code CustomAlbum.shared.saveImage(image: UIImage()) save image like this. import Foundation import…
Anis Mansuri
  • 335
  • 3
  • 10
0
votes
1 answer

Swift iOS: -How to exclude .livePhotos from inclusion in the PHFetchOptions?

Following @matt's code when using the UIImagePicker, I can prevent the user from picking a .livePhoto once an image is choosen using: let asset = info[UIImagePickerControllerPHAsset] as? PHAsset if asset?.playbackStyle == .livePhoto { // alert…
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
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
0 answers

Photos Framework not giving pictures synced from iTunes in iOS

I'm using Photos Framework to fetch all photos and albums PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .albumRegular, options: nil) But it is not giving those picture and albums which i have transferred from my mac to iPhone…
Abhishek Thapliyal
  • 3,497
  • 6
  • 30
  • 69
0
votes
0 answers

Customize the camera roll and show the icon on iCloud media

Is there any way to check the media is physically available on device. In other words how to identify the iCloud media using swift or objective c. I have tried to access below property but seems there is some issue with that. public struct…
Nit
  • 1
  • 2
0
votes
1 answer

PHAsset - Property way to save captured PHAssets locally? (in app)

trying to understand the concept for Photos/Photos.h framework. my goal is: write captured video url (or asset) to app's "userDefaults". read from "userDefaults", & fetch each saved asset data (thumbnail & url)
Ofir Malachi
  • 1,145
  • 14
  • 20
0
votes
1 answer

PHAssetCollection for "Camera Roll" and "My Photo Stream" is empty

im trying to present a list of all the albums titles in my iphone and when i press a title i want it to present all the photos of that specific album in a collection view.I am using the "PhotosUI" framework and i use this code to get the album…
aviv_elk
  • 416
  • 1
  • 9
  • 21