|
@@ -10,15 +10,15 @@ import UIKit
|
|
import FileProviderUI
|
|
import FileProviderUI
|
|
|
|
|
|
class DocumentActionViewController: FPUIActionExtensionViewController {
|
|
class DocumentActionViewController: FPUIActionExtensionViewController {
|
|
-
|
|
|
|
|
|
+
|
|
@IBOutlet weak var identifierLabel: UILabel!
|
|
@IBOutlet weak var identifierLabel: UILabel!
|
|
@IBOutlet weak var actionTypeLabel: UILabel!
|
|
@IBOutlet weak var actionTypeLabel: UILabel!
|
|
-
|
|
|
|
|
|
+
|
|
override func prepare(forAction actionIdentifier: String, itemIdentifiers: [NSFileProviderItemIdentifier]) {
|
|
override func prepare(forAction actionIdentifier: String, itemIdentifiers: [NSFileProviderItemIdentifier]) {
|
|
identifierLabel?.text = actionIdentifier
|
|
identifierLabel?.text = actionIdentifier
|
|
actionTypeLabel?.text = "Custom action"
|
|
actionTypeLabel?.text = "Custom action"
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
override func prepare(forError error: Error) {
|
|
override func prepare(forError error: Error) {
|
|
identifierLabel?.text = error.localizedDescription
|
|
identifierLabel?.text = error.localizedDescription
|
|
actionTypeLabel?.text = "Authenticate"
|
|
actionTypeLabel?.text = "Authenticate"
|
|
@@ -28,10 +28,8 @@ class DocumentActionViewController: FPUIActionExtensionViewController {
|
|
// Perform the action and call the completion block. If an unrecoverable error occurs you must still call the completion block with an error. Use the error code FPUIExtensionErrorCode.failed to signal the failure.
|
|
// Perform the action and call the completion block. If an unrecoverable error occurs you must still call the completion block with an error. Use the error code FPUIExtensionErrorCode.failed to signal the failure.
|
|
extensionContext.completeRequest()
|
|
extensionContext.completeRequest()
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@IBAction func cancelButtonTapped(_ sender: Any) {
|
|
@IBAction func cancelButtonTapped(_ sender: Any) {
|
|
extensionContext.cancelRequest(withError: NSError(domain: FPUIErrorDomain, code: Int(FPUIExtensionErrorCode.userCancelled.rawValue), userInfo: nil))
|
|
extensionContext.cancelRequest(withError: NSError(domain: FPUIErrorDomain, code: Int(FPUIExtensionErrorCode.userCancelled.rawValue), userInfo: nil))
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|