Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Metadata tutorial from plymouthsoftware.com
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]){
imagePicker.dismissViewControllerAnimated(true, completion: nil)
var selectedImage = info[UIImagePickerControllerOriginalImage] as! UIImage
var metadata: NSDictionary
var library:ALAssetsLibrary? = ALAssetsLibrary()
// Get the images meta data
if(picker.sourceType == .Camera) {
metadata = info[UIImagePickerControllerMediaMetadata] as! NSDictionary
} else {
var referenceURL : NSURL = info[UIImagePickerControllerReferenceURL] as! NSURL
library!.assetForURL(referenceURL, resultBlock: { (asset : ALAsset!) -> Void in
var rep : ALAssetRepresentation = asset.defaultRepresentation()
var metadata : NSDictionary = rep.metadata()
})
{
(error : NSError!) -> Void in
}
}
picker.dismissViewControllerAnimated(true, completion: nil);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.