谁能帮我理解Document Picker Extension。它如何在应用程序中工作?
我正在按照此处给出的步骤进行操作(请参阅生命周期)
但我的 UIDocumentPickerViewExtensionViewController 子类没有启动
@IBAction func selectImageAction(sender : UIBarButtonItem)
{
var url = NSURL.fileURLWithPath(NSBundle.mainBundle().pathForResource("2", ofType: "png"))
var docPicker = UIDocumentMenuViewController(URL: url, inMode: UIDocumentPickerMode.ExportToService)
docPicker.delegate = self
docPicker.modalPresentationStyle = UIModalPresentationStyle.Popover;
self.presentViewController(docPicker, animated: true, completion: nil)
}
func documentMenu(documentMenu: UIDocumentMenuViewController!, didPickDocumentPicker documentPicker: UIDocumentPickerViewController!)
{
/*This method is not loading my UIDocumentPickerViewExtensionViewController subclass
I have set all key value in plist for that*/
documentPicker.view.backgroundColor = UIColor.clearColor()
documentPicker.delegate = self
self.presentViewController(documentPicker, animated: true, completion: nil)
}
我想从我的主机应用程序共享 1 个文件,然后使用iOS 8上的Document Picker Extension在另一个应用程序中使用。
任何处于工作状态的演示都会非常有帮助。
提前致谢。