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

How to fetch PHAsset from assetURL in Photos framework?

I want to fetch PHAsset using assetURL. I used the following code : NSURL *assetURL=[NSURL URLWithString:file.filePath]; PHFetchResult *fetchResult=[PHAsset fetchAssetsWithALAssetURLs:@[assetURL] options:nil]; PHAsset *asset=…
Priyanka
  • 442
  • 1
  • 5
  • 13
0
votes
1 answer

Putting videos in one specific Album in camera roll

I am creating a specific album in my camera roll.. But for my every run, its creating a new album in my camera roll instead of putting the videos together to the same album.. Ideas? __block PHObjectPlaceholder *assetCollectionPlaceholder; …
dicle
  • 1,122
  • 1
  • 12
  • 40
0
votes
1 answer

PHAsset fetch returns 50% of the collection as nil

When I take a PHAssetCollection and give it to PHAsset.fetchAssetsInAssetCollection:options I am given back a collection of PHAssets. For every UIImage given back to me, there is a nil value given back as well. The following is my…
Johnathon Sullinger
  • 7,097
  • 5
  • 37
  • 102
0
votes
1 answer

Photos framework working abnormally.

I am using Photos framework to select photos from the Camera roll. After selecting the assets from the grid, I am using PHImageManager to access each of the selected images and then storing these images in array to show in a collection view of…
0
votes
0 answers

PHAssetMediaSubtypePhotoScreenshot for iOS8

The title makes it self explanatory I think Since ALAssets library is deprecated I'm trying to convert everything over from a project I started on a while back. Photos framework has a typedef enum for PHAssetMediaSubtype and it makes it easy to…
soulshined
  • 9,612
  • 5
  • 44
  • 79
0
votes
1 answer

Delete a single photo from a burst from the camera roll in Swift

So I have code that will delete images from the camera roll. It works fine, and can delete single images from a burst, however one of the images, if deleted, will delete the entire batch and I can't figure out how to stop that. It usually seems to…
Individual11
  • 374
  • 4
  • 16
0
votes
1 answer

Is it possible to get photos stored on the iPhone without PHAsset?

Is it possible to get the photos stored on the iPhone without use PHAsset ? It's because the use of PHAsset forces me to use this method : PHImageManager.defaultManager().requestImageForAsset( ... ) And this method takes times to be…
testa abalez
  • 1,042
  • 3
  • 13
  • 28
0
votes
0 answers

"PHAssetCollectionSubtypeAlbumSyncedAlbum" not returning photos synced from Photos for Mac

I can't figure out how to get photos that are synced with Photos for Mac via iTunes to an iPhone to appear in PHAsset-based interactions. I've tried every since album subtype, and it's just not working. It only shows camera roll, and various other…
Ben Guild
  • 4,881
  • 7
  • 34
  • 60
0
votes
2 answers

Getting last picture taken from users photo library returning two pictures

When using the following code, it gets my last picture, but it duplicates it. It always gets the last picture, but it returns in a pair: UIImageView *imageView = (UIImageView *) [self.photoCollectionView viewWithTag:101]; PHFetchOptions…
Jteve Sobs
  • 244
  • 1
  • 14
0
votes
1 answer

PHCachingImageManager - Cache Location and File Name

I need to pass the file location and name of an Asset I saved using PHCachingImageManager over to my web server. I cannot see anything in the documentation on how and where to retrieve this. I am using self.imageManager = [[PHCachingImageManager…
Ryan Heitner
  • 13,119
  • 6
  • 77
  • 119
0
votes
2 answers

Convert NSUrl to PHAsset iOS 8

I have a list of pictures in NSUrl format that I want to convert to PHAsset list of object. How can I perform it? My goal is to upload a list of pictures to my view on viewDidLoad state. I started to work with the PHAssets library in iOS 8 and above…
Avi Levin
  • 1,868
  • 23
  • 32
0
votes
1 answer

Videos recorded from app has incorrect creation date from PHAsset

I have an app that records video and displays them in a certain order. The videos recorded in my app has the correct date, but the times were all the same. So, all of the video recorded today show: 2015-07-31 13:15:51 +0000 I'm not setting any…
yamski
  • 471
  • 4
  • 14
0
votes
1 answer

(PHAsset location) returns (null) for Camera Roll photo even though location services are enabled

I need to access the GPS coordinates of user-submitted photos that originate from the user's camera roll/photo library. I'm implementing PHAsset instead of ALAsset for the sake of modernity. I know that location services ARE enabled because I can…
kmb
  • 3
  • 2
0
votes
1 answer

How to I extract a PHAsset's Location property?

Xcode says that PHAsset doesn't have the 'location' member. What's the remedy for Swift?
Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105
0
votes
2 answers

PhotoKit frameWork : What is assetSource of PHAsset?

When I print the description of PHAsset , it includes assetSource=3 or assetSource=0. May I know what does this assetSource mean? What are the numbers like 3,0 related to? As per my observation for a particular PHAsset with assetSource=3 its…
rishu1992
  • 1,414
  • 3
  • 14
  • 33