2016-07-15 54 views
0

我想在我的應用程序中上傳pdf文件。如何列出iPhone的PDF文件?

我的問題是如何我會得到PDF列表?像UIImagepicker是否有文檔選取器的任何控制器。

請幫幫我。

+0

您可以嘗試快速查看框架的工作。 –

+3

從哪裏你要選擇pdf文件?從您的應用程序的捆綁包或文檔目錄?或從任何其他應用程序? – Lion

回答

0

我認爲你正在尋找UIDocumentMenuViewController

您可以參考蘋果的DocumentPickerProgrammingGuide

你可以做這樣的事情,

UIDocumentMenuViewController *myDocumentMenu = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:docArr inMode:UIDocumentPickerModeImport]; 
myDocumentMenu.delegate = self; 

[self presentViewController: myDocumentMenu animated:YES completion: ^{ 
    NSLog(@"presented sucessfullly"); 
}]; 

您也可以參考Appcoda's tutorial