swift:UIDocumentPickerViewController-plugin com.apple.UIKit.fileprovider.default失效

时间:2017-01-18 04:45:43

标签: ios swift uikit uidocumentpickervc

我有关于插件配置的问题。我搜索但在任何地方都找不到答案。这是我的代码

import UIKit
import MobileCoreServices
class ViewController: UIViewController, UIDocumentPickerDelegate,UITextViewDelegate {

@IBOutlet weak var webView: UIWebView!
@IBOutlet weak var emailButton: UIButton!
 @IBOutlet weak var UITextField: UITextView!
override func viewDidLoad() {

    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.

}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.

}

@IBAction func handleImportPickerPressed(sender: AnyObject) {

    let documentPicker = UIDocumentPickerViewController(documentTypes:["public.data", "public.text"],inMode:  UIDocumentPickerMode.Import)
    documentPicker.delegate = self
    documentPicker.modalPresentationStyle = UIModalPresentationStyle.FormSheet
    presentViewController(documentPicker, animated: true, completion: nil)
}

func documentPicker(controller: UIDocumentPickerViewController, didPickDocumentAtURL url: NSURL) {

  print(url)
    if controller.documentPickerMode == UIDocumentPickerMode.Open{
        print("this is a Open")



    }
    if controller.documentPickerMode == UIDocumentPickerMode.Import{
         print("this is a Import")
    }
    if controller.documentPickerMode == UIDocumentPickerMode.ExportToService{
         print("this is a ExportToService")

    }

    if controller.documentPickerMode == UIDocumentPickerMode.MoveToService{
        print("this is a MoveToService")


    }

    }

    }

并且控制台中的输出也是 这是一个导入 2017-01-18 10:29:22.968 IBooksTest [442:43393]插件com.apple.UIKit.fileprovider.default无效

这里有什么问题,或者我的方向是错误的?我甚至看过类似的问题Here,但问题仍然是一样的。 谢谢,

0 个答案:

没有答案