DocumentPickerViewController.swift 752 B

123456789101112131415161718192021222324
  1. //
  2. // DocumentPickerViewController.swift
  3. // Picker
  4. //
  5. // Created by Marino Faggiana on 27/12/16.
  6. // Copyright © 2016 TWS. All rights reserved.
  7. //
  8. import UIKit
  9. class DocumentPickerViewController: UIDocumentPickerExtensionViewController {
  10. @IBAction func openDocument(_ sender: AnyObject?) {
  11. let documentURL = self.documentStorageURL!.appendingPathComponent("Untitled.txt")
  12. // TODO: if you do not have a corresponding file provider, you must ensure that the URL returned here is backed by a file
  13. self.dismissGrantingAccess(to: documentURL)
  14. }
  15. override func prepareForPresentation(in mode: UIDocumentPickerMode) {
  16. // TODO: present a view controller appropriate for picker mode here
  17. }
  18. }