Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get image created date time or last modified date time from iOS Photos (like camera roll)?

Tags:

ios

image

alasset

I am a new guy to iOS. Recently, I am developing an iOS application need to check image (in iOS Photos) created date time and modified date time to sort these images by time. I used ALAssetsLibrary to enumerate all images, i can get following attributes of each image: image file name, image asset url (within it, i can get image file extension and unique asset id). But could someone tell me how to get the image file created date time and last modified date time?

Thanks very much.

like image 687
evanchin Avatar asked Jan 17 '23 15:01

evanchin


1 Answers

You can retrieve the creation date of the asset using the ALAssetPropertyDate property:

ALAsset* asset;
...
NSDate* date = [asset valueForProperty:ALAssetPropertyDate];

I'm not sure of a method to retrieve the last modified date.

like image 83
andybons Avatar answered Jan 31 '23 01:01

andybons