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

限于喜欢 提交于 2019-12-30 03:32:05

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/10638567/how-can-i-get-image-created-date-time-or-last-modified-date-time-from-ios-photos

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!