0

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?

enter image description here

Jan
  • 653
  • 1
  • 7
  • 22

1 Answers1

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