12345678910111213141516171819202122232425262728293031323334353637 |
- import UIKit
- import FileProviderUI
- class DocumentActionViewController: FPUIActionExtensionViewController {
-
- @IBOutlet weak var identifierLabel: UILabel!
- @IBOutlet weak var actionTypeLabel: UILabel!
-
- override func prepare(forAction actionIdentifier: String, itemIdentifiers: [NSFileProviderItemIdentifier]) {
- identifierLabel?.text = actionIdentifier
- actionTypeLabel?.text = "Custom action"
- }
-
- override func prepare(forError error: Error) {
- identifierLabel?.text = error.localizedDescription
- actionTypeLabel?.text = "Authenticate"
- }
- @IBAction func doneButtonTapped(_ sender: Any) {
-
- extensionContext.completeRequest()
- }
-
- @IBAction func cancelButtonTapped(_ sender: Any) {
- extensionContext.cancelRequest(withError: NSError(domain: FPUIErrorDomain, code: Int(FPUIExtensionErrorCode.userCancelled.rawValue), userInfo: nil))
- }
-
- }
|