if let uiImage = UIImage(data: data) {
pictureCaptionViewModel.inputImage = uiImage
let image = CIImage(cgImage: uiImage.cgImage!)
let properties = image.properties
if let gps = properties[kCGImagePropertyGPSDictionary as String] as? [String: Any] {
let lat = gps[kCGImagePropertyGPSLatitude as String] as! Double
let lon = gps[kCGImagePropertyGPSLongitude as String] as! Double
print(lat, lon)
}
}
}
I was not able to get the the lat lon. I loaded the image(with location) using PhotoPicker.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: