我有关于插件配置的问题。我搜索但在任何地方都找不到答案。这是我的代码
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")
}
}
}
控制台中的输出也是 Import 2017-01-18 10:29:22.968 IBooksTest[442:43393] plugin com.apple.UIKit.fileprovider.default invalidated
这里有什么问题还是我走错了方向?我什至在这里查看了类似的问题,但问题仍然相同。谢谢,