0
swift3에서 pdf 문서를 선택하려고했지만 PDF 문서를 선택할 수 없습니다. 제 코드를 확인하십시오.swift3에서 PDF 문서 따기
class ViewController: UIViewController, UIDocumentPickerDelegate, UIDocumentMenuDelegate,UINavigationControllerDelegate {
@IBAction func clickAction(_ sender: Any) {
let picker = UIDocumentPickerViewController(documentTypes: [kUTTypePDF as String], in: .import)
picker.delegate = self
present(picker, animated:true, completion:nil)
}
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL){
let fileText = try NSString(contentsOf: url, encoding: String.Encoding.utf8.rawValue)
print(fileText)
}
}