0

I’m unable to select the document documents they are greyed out

I have tried with

UIDocumentPickerViewController - each file that was picked once is then grayed out





import UIKit
import MobileCoreServices
import UniformTypeIdentifiers

class ViewController: UIViewController, UINavigationControllerDelegate, UIDocumentPickerDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }
    @IBAction func ShowPicker(_ sender: Any) {
        let pickerViewController = UIDocumentPickerViewController(forOpeningContentTypes: [.pdf], asCopy: true)
        pickerViewController.delegate = self
        pickerViewController.allowsMultipleSelection = false
        pickerViewController.shouldShowFileExtensions = true
        present(pickerViewController, animated: true, completion: nil)
        
    }
    
    func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
        print("Cancelled")
    }

    func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
        print("didPickDocuments at \(urls)")
    }
}
Aswanth
  • 1
  • 1

0 Answers0