If pictures are loaded into an app from a album, how is it possible to get the date of that picture displayed on a app like on the screenshot below?
Asked
Active
Viewed 1,097 times
0
-
look here http://stackoverflow.com/questions/12478502/how-to-get-image-metadata-in-ios – shannoga Dec 22 '14 at 22:07
1 Answers
2
You can use ALAsset library, it contain the property called ALAssetPropertyDate. So using that you can fetch the date like that below:-
NSURL *url = @"your url";
ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init];
[assetslibrary assetForURL:url
resultBlock:^(ALAsset *asset) {
NSDate *myDate = [asset valueForProperty:ALAssetPropertyDate];
NSLog(@"Date: %@", myDate);
} failureBlock:^(NSError *error) {
NSLog(@"Error");
}];

Hussain Shabbir
- 14,801
- 5
- 40
- 56
-
-
-
-
Let me know if you find difficulty to convert string into url? – Hussain Shabbir Dec 22 '14 at 23:20
-
This is how I fetch the image.. - (void)setImage:(UIImage *)image { _image = image; self.imageView.image = image; } – Jan Dec 22 '14 at 23:21
-
-
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/67505/discussion-between-hussain-shabbir-and-jan). – Hussain Shabbir Dec 22 '14 at 23:24