Use split view for Settings

This commit is contained in:
Bob Sun 2017-06-22 00:09:12 -07:00
parent d25cc9eb9a
commit 72424c7db2
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
7 changed files with 143 additions and 116 deletions

View file

@ -88,9 +88,6 @@ class AdvancedSettingsTableViewController: UITableViewController {
SharedDefaults[.encryptInArmored] = encryptInASCIIArmoredSwitch.isOn
}
@IBAction func cancelGitConfigSetting(segue: UIStoryboardSegue) {
}
@IBAction func saveGitConfigSetting(segue: UIStoryboardSegue) {
if let controller = segue.source as? GitConfigSettingTableViewController {
if let gitSignatureName = controller.nameTextField.text,

View file

@ -204,9 +204,4 @@ class PGPKeyArmorSettingTableViewController: UITableViewController, UITextViewDe
}
}
}
@IBAction private func cancelPGPScanner(segue: UIStoryboardSegue) {
}
}

View file

@ -234,10 +234,6 @@ class PasswordEditorTableViewController: UITableViewController, FillPasswordTabl
}
}
@IBAction private func cancelOTPScanner(segue: UIStoryboardSegue) {
}
// update the data table after editing
func textFieldDidEndEditing(_ textField: UITextField) {
if textField == nameCell?.contentTextField {

View file

@ -0,0 +1,24 @@
//
// SettingsSplitViewController.swift
// pass
//
// Created by Mingshen Sun on 6/21/17.
// Copyright © 2017 Bob Sun. All rights reserved.
//
import UIKit
class SettingsSplitViewController: UISplitViewController, UISplitViewControllerDelegate {
override func viewDidLoad() {
self.delegate = self
self.preferredDisplayMode = .allVisible
}
func splitViewController(
_ splitViewController: UISplitViewController,
collapseSecondary secondaryViewController: UIViewController,
onto primaryViewController: UIViewController) -> Bool {
// Return true to prevent UIKit from applying its default behavior
return true
}
}

View file

@ -28,9 +28,6 @@ class SettingsTableViewController: UITableViewController {
@IBOutlet weak var passwordRepositoryTableViewCell: UITableViewCell!
let passwordStore = PasswordStore.shared
var passcodeLockConfig = PasscodeLockConfiguration.shared
@IBAction func cancelPGPKey(segue: UIStoryboardSegue) {
}
@IBAction func savePGPKey(segue: UIStoryboardSegue) {
if let controller = segue.source as? PGPKeySettingTableViewController {
@ -117,9 +114,6 @@ class SettingsTableViewController: UITableViewController {
}
}
@IBAction func cancelGitServerSetting(segue: UIStoryboardSegue) {
}
@IBAction func saveGitServerSetting(segue: UIStoryboardSegue) {
self.passwordRepositoryTableViewCell.detailTextLabel?.text = SharedDefaults[.gitURL]?.host
}