Using the following code, RAW/DNG images loose their location data when exported to a different device or computer.
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
PHAssetResourceCreationOptions *options = [[PHAssetResourceCreationOptions alloc] init];
options.shouldMoveFile = YES;
PHAssetCreationRequest *creationRequest = [PHAssetCreationRequest creationRequestForAsset];
creationRequest.location = locManager.location;
if(rawEmbedsJPEGOnOff == 0){
[creationRequest addResourceWithType:PHAssetResourceTypePhoto data:photoData options:nil];
[creationRequest addResourceWithType:PHAssetResourceTypeAlternatePhoto fileURL:temporaryFormatFileURL options:options]; // Add move (not copy) option
}
else if(rawEmbedsJPEGOnOff == 1){
[creationRequest addResourceWithType:PHAssetResourceTypePhoto fileURL:temporaryFormatFileURL options:options];
}
} completionHandler:^( BOOL success, NSError *error ){
if(!success){
NSLog( @"Error occurred while saving raw photo to photo library: %@", error );
}
else{
NSLog( @"Raw photo was saved to photo library" ); }];