title: How to get metadata from asset url of photo
body: <p>I'm making a camera app for iOS that includes metadata for the photos.  I used the assetlibrary to write the metadata.  The method "writeImageDataToSavedPhotoAlbum" has a completion block that returns an asset URL.  I assume I need to save this URL so I can retrieve the metadata and image.  However, I can't seem to figure out what to do with the assetURL so that I get my information.</p>
  
  <p>My code: </p>
  
  <pre><code>- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
  NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
  if ([mediaType isEqualToString:(__bridge NSString *)kUTTypeMovie]){
      NSURL *urlOfVideo = [info objectForKey:UIImagePickerControllerMediaURL];
  } else if ([mediaType isEqualToString:(__bridge NSString *)kUTTypeImage]) {
  
      CLLocation *location = [[CLLocation alloc] init];
  
      NSDictionary *metadata = [self getGPSDictionaryForLocation:location];
  
      UIImage *theImage = [info objectForKey:UIImagePickerControllerOriginalImage];
      ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];
  
      NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(theImage)];
      [library writeImageDataToSavedPhotosAlbum:imageData metadata:metadata completionBlock:^(NSURL *assetURL, NSError *error){
          if (error) {
              NSLog(@"error");
          } else {
  
  ////what do I do with the assetURL?
  
              self.imageURL = assetURL;
              NSLog(@"url %@", self.imageURL);
  
          }
      } ];
  
  }
  
  
  [picker dismissViewControllerAnimated:YES completion:nil];
  }
  </code></pre>