2015-09-08 27 views
0

我正在開發一款照相機應用程序,可用於拍照並將其保存在單獨的相冊中。我使用照片框架來保存圖像,現在我需要將圖片(可能位於元數據中)保存爲GPS數據(拍攝圖片的位置)。我搜索了任何使用照片框架來做這件事的方法,但是我失敗了,我找不到任何相關的東西。任何幫助將不勝感激。如何在ios中使用拍攝的照片保存GPS數據

這是我用來保存圖片

[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ 

    PHAssetChangeRequest *assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:capturedImage]; 

    placeholder = [assetRequest placeholderForCreatedAsset]; 

    photosAsset = [PHAsset fetchAssetsInAssetCollection:Album options:nil]; 

    PHAssetCollectionChangeRequest *albumChangeRequest = [PHAssetCollectionChangeRequest changeRequestForAssetCollection:Album            assets:photosAsset]; 

    [albumChangeRequest addAssets:@[placeholder]]; 

} completionHandler:^(BOOL success, NSError *error) { 

    if (success) 
    { 

    } 
    else 
    { 

    } 

}]; 

回答

0

的代碼和平我假設你想要的緯度經度&。您是否嘗試過PHAsset類的位置屬性?

+0

我可以訪問exif數據,但找不到保存方式。 – GMHSJ

+0

http://stackoverflow.com/questions/9766394/get-exif-data-from-uiimage-uiimagepickercontroller 這有幫助嗎? – jarora

+0

使用AssertLibrary是可能的。我知道。我想用照片框架來做,因爲AsserLibrary在我記憶中已經從ios 9或8棄用。 – GMHSJ