Last active
November 3, 2018 08:04
-
-
Save urouro-net/3f6d2574ee6ad6996ed49e28ac822b97 to your computer and use it in GitHub Desktop.
PHAsset Exif
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
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