Last active
August 29, 2015 14:22
-
-
Save tonyedwardspz/c90a34627c7d536f7f3f to your computer and use it in GitHub Desktop.
Metadata tutorial from plymouthsoftware.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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