Move class to own file
This commit is contained in:
parent
b3eef51a9d
commit
942f462db8
3 changed files with 38 additions and 25 deletions
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// PasscodeLockViewControllerForExtension.swift
|
||||
// passAutoFillExtension
|
||||
//
|
||||
// Created by Danny Moesch on 24.08.21.
|
||||
// Copyright © 2021 Bob Sun. All rights reserved.
|
||||
//
|
||||
|
||||
import passKit
|
||||
|
||||
class PasscodeLockViewControllerForExtension: PasscodeLockViewController {
|
||||
var originalExtensionContext: NSExtensionContext!
|
||||
|
||||
convenience init(extensionContext: NSExtensionContext) {
|
||||
self.init()
|
||||
self.originalExtensionContext = extensionContext
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
cancelButton?.removeTarget(nil, action: nil, for: .allEvents)
|
||||
// cancel means cancel the extension
|
||||
cancelButton?.addTarget(self, action: #selector(cancelExtension), for: .touchUpInside)
|
||||
}
|
||||
|
||||
@objc
|
||||
func cancelExtension() {
|
||||
originalExtensionContext.cancelRequest(withError: NSError(domain: "PassExtension", code: 0))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue