This commit is contained in:
Bob Sun 2018-01-16 20:26:41 -08:00
parent 374c6c8c10
commit a0ecc6c0e4
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
2 changed files with 53 additions and 48 deletions

View file

@ -13,7 +13,7 @@ import PasscodeLock
import LocalAuthentication
import passKit
class SettingsTableViewController: UITableViewController {
class SettingsTableViewController: UITableViewController, UITabBarControllerDelegate {
lazy var touchIDSwitch: UISwitch = {
let uiSwitch = UISwitch(frame: CGRect.zero)
@ -29,6 +29,10 @@ class SettingsTableViewController: UITableViewController {
let passwordStore = PasswordStore.shared
var passcodeLockConfig = PasscodeLockConfiguration.shared
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
navigationController?.popViewController(animated: true)
}
@IBAction func savePGPKey(segue: UIStoryboardSegue) {
if let controller = segue.source as? PGPKeySettingTableViewController {
SharedDefaults[.pgpPrivateKeyURL] = URL(string: controller.pgpPrivateKeyURLTextField.text!)
@ -132,6 +136,7 @@ class SettingsTableViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
tabBarController!.delegate = self
NotificationCenter.default.addObserver(self, selector: #selector(SettingsTableViewController.actOnPasswordStoreErasedNotification), name: .passwordStoreErased, object: nil)
self.passwordRepositoryTableViewCell.detailTextLabel?.text = SharedDefaults[.gitURL]?.host
touchIDTableViewCell.accessoryView = touchIDSwitch