Skip to content

Instantly share code, notes, and snippets.

@urouro-net
Last active November 3, 2018 08:04
Show Gist options
  • Save urouro-net/3f6d2574ee6ad6996ed49e28ac822b97 to your computer and use it in GitHub Desktop.
Save urouro-net/3f6d2574ee6ad6996ed49e28ac822b97 to your computer and use it in GitHub Desktop.
PHAsset Exif
let editOptions = PHContentEditingInputRequestOptions()
editOptions.isNetworkAccessAllowed = true
asset.requestContentEditingInput(with: editOptions) { (contentEditingInput: PHContentEditingInput?, info: [AnyHashable : Any]) in
if let fileURL = contentEditingInput?.fullSizeImageURL {
let image = CIImage(contentsOf: fileURL)
log.debug("properties=\(image?.properties)")
if let gps = image?.properties["{GPS}"] as? [AnyHashable : Any] {
lat = gps["Latitude"] as? Double
lng = gps["Longitude"] as? Double
}
} else {
log.debug("")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment