iOS 8中的文档选择器扩展

时间:2014-06-19 06:00:11

标签: ios objective-c swift ios8 ios-app-extension

任何人都可以帮助我理解文档选择器扩展。 它在应用程序中如何运作?

我正在执行here给出的步骤(参见生命周期

但我的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 上使用文档选择器扩展在另一个应用程序中使用。

任何处于工作状态的演示都会非常有用。

提前致谢。

0 个答案:

没有答案