Hi i am new to ios,I am developing the apps,So for that i am choosing the photos from gallery.While choosing the photos i want to get the lat/long of that selected image for Google map.So please help me to get the code.i am using Xcode 7.3 ,Swift 2, IOS 9.3 .
I tried this code.
From this below code , i need lat and long alone.
if picker.sourceType == UIImagePickerControllerSourceType.PhotoLibrary
let assetURL = info[UIImagePickerControllerReferenceURL] as! NSURL
let asset = PHAsset.fetchAssetsWithALAssetURLs([assetURL], options: nil)
guard let result = asset.firstObject where result is PHAsset else {
return
}
let imageManager = PHImageManager.defaultManager()
imageManager.requestImageDataForAsset(result as! PHAsset, options: nil, resultHandler:{
(data, responseString, imageOriet, info) -> Void in
let imageData: NSData = data!
if let imageSource = CGImageSourceCreateWithData(imageData, nil) {
let imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, nil)! as NSDictionary
/
print(imageProperties)
}
})
}