How to save a photo in a photo library with geolocation metadata?
I asked (and allowed) the application to access the user's location:
private func allowAccessToUserLocation() {
locationManager = CLLocationManager()
locationManager.delegate = self
locationManager.requestWhenInUseAuthorization()
}
Do I need to request specific offers for the camera application?
EDIT:
I use UIImagePickerController to take photos from the application. All photos taken from the application are stored in the photo library WITHOUT geolocation.
Does this have anything to do with how I can save the image in the photo library? Is my problem here, not the permissions of the main location?
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
if let pickedImage = info[UIImagePickerControllerOriginalImage] as? UIImage{
UIImageWriteToSavedPhotosAlbum(pickedImage, self, #selector(image(_:didFinishSavingWithError:contextInfo:)), nil)
dismiss(animated: true, completion: {
self.showPhoto()})
}
}
source
share