2015-03-02 78 views
2

我正在製作iOS應用程序照片並將照片本地存儲在我的應用程序中。我必須編輯一些照片。所以,我必須寫很多代碼才能像蘋果照片應用一樣。而不是自己編寫代碼有沒有什麼可能的方式來訪問iPhone的照片應用程序,只是爲了從我的應用程序進行編輯。是否可以使用擴展程序訪問照片編輯功能?提前致謝!是否可以從我的應用程序訪問照片編輯擴展

回答

0

我不完全是什麼意思的擴展名,但你可以使用UIImagePickerController(這裏的類參考https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImagePickerController_Class/和示例代碼https://developer.apple.com/library/prerelease/ios/samplecode/PhotoPicker/Introduction/Intro.html)訪問照片庫。並且您可以允許進行如下編輯:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; 
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { 
    [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera]; 
} else { 
    [imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; 
} 

[imagePicker setAllowsEditing:YES]; 
[imagePicker setDelegate:self]; 
+0

擴展名錶示應用擴展程序。你可能聽說iOS允許使用第三方鍵盤。那些正在使用擴展。 https://developer.apple.com/app-extensions/ – sateesh 2015-03-02 07:13:15

+0

啊,應用程序擴展thingie。可悲的是,從我個人的經歷來看,你可以觸發一些行爲,比如打開選擇器視圖和東西。但是你必須自己實現整個編輯功能。 – 2015-03-02 07:16:41

+0

所以你在說什麼是我不能使用其他應用程序擴展名進行照片編輯。 – sateesh 2015-03-02 07:22:58

相關問題