1234567891011121314151617181920212223242526272829303132333435363738394041 |
- 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) {
- if let userInfo = (error as NSError).userInfo as NSDictionary?,
- let code = userInfo["code"] as? Int {
- if code == NCGlobal.shared.errorUnauthorizedFilesPasscode {
- identifierLabel?.text = "AAAAAAAA"
- }
- } else {
- identifierLabel?.text = error.localizedDescription
- }
- }
- @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))
- }
- }
|