Hide unknown fields
This commit is contained in:
parent
3145ddacbe
commit
fe1c01c6dc
6 changed files with 40 additions and 9 deletions
|
|
@ -299,7 +299,7 @@
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
DC917BD21E2E8231000FDF54 = {
|
DC917BD21E2E8231000FDF54 = {
|
||||||
CreatedOnToolsVersion = 8.2.1;
|
CreatedOnToolsVersion = 8.2.1;
|
||||||
DevelopmentTeam = 779BQYPRCF;
|
DevelopmentTeam = 4WDM8E95VU;
|
||||||
ProvisioningStyle = Automatic;
|
ProvisioningStyle = Automatic;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -571,7 +571,7 @@
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
DEFINES_MODULE = NO;
|
DEFINES_MODULE = NO;
|
||||||
DEVELOPMENT_TEAM = 779BQYPRCF;
|
DEVELOPMENT_TEAM = 4WDM8E95VU;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||||
|
|
@ -600,7 +600,7 @@
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
DEFINES_MODULE = NO;
|
DEFINES_MODULE = NO;
|
||||||
DEVELOPMENT_TEAM = 779BQYPRCF;
|
DEVELOPMENT_TEAM = 4WDM8E95VU;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,39 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import SwiftyUserDefaults
|
||||||
|
|
||||||
class GeneralSettingsTableViewController: BasicStaticTableViewController {
|
class GeneralSettingsTableViewController: BasicStaticTableViewController {
|
||||||
|
|
||||||
|
let hideUnknownSwitch = UISwitch(frame: CGRect.zero)
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
navigationItemTitle = "General"
|
navigationItemTitle = "General"
|
||||||
tableData = [
|
tableData = [
|
||||||
// section 0
|
// section 0
|
||||||
[[.title: "About Repository", .action: "segue", .link: "showAboutRepositorySegue"],],
|
[[.title: "About Repository", .action: "segue", .link: "showAboutRepositorySegue"],],
|
||||||
|
[[.title: "Hide Unkonwn Fields", .action: "none",],],
|
||||||
|
|
||||||
]
|
]
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||||
|
let cell = super.tableView(tableView, cellForRowAt: indexPath)
|
||||||
|
if indexPath == IndexPath(row: 0, section: 1) {
|
||||||
|
cell.accessoryType = .none
|
||||||
|
hideUnknownSwitch.onTintColor = UIColor(displayP3Red: 0, green: 122.0/255, blue: 1, alpha: 1)
|
||||||
|
cell.accessoryView = hideUnknownSwitch
|
||||||
|
cell.selectionStyle = .none
|
||||||
|
hideUnknownSwitch.addTarget(self, action: #selector(hideUnknownSwitchAction(_:)), for: UIControlEvents.valueChanged)
|
||||||
|
hideUnknownSwitch.isOn = Defaults[.isHideUnknownOn]
|
||||||
|
}
|
||||||
|
return cell
|
||||||
|
}
|
||||||
|
|
||||||
|
func hideUnknownSwitchAction(_ sender: Any?) {
|
||||||
|
Defaults[.isHideUnknownOn] = hideUnknownSwitch.isOn
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import FavIcon
|
import FavIcon
|
||||||
|
import SwiftyUserDefaults
|
||||||
|
|
||||||
class PasswordDetailTableViewController: UITableViewController, UIGestureRecognizerDelegate {
|
class PasswordDetailTableViewController: UITableViewController, UIGestureRecognizerDelegate {
|
||||||
var passwordEntity: PasswordEntity?
|
var passwordEntity: PasswordEntity?
|
||||||
|
|
@ -147,7 +148,10 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
|
||||||
self.tableData.append(TableSection(title: "additions", item: []))
|
self.tableData.append(TableSection(title: "additions", item: []))
|
||||||
tableDataIndex += 1
|
tableDataIndex += 1
|
||||||
for additionKey in password.additionKeys {
|
for additionKey in password.additionKeys {
|
||||||
self.tableData[tableDataIndex].item.append(TableCell(title: additionKey, content: password.additions[additionKey]!))
|
if !additionKey.contains("unknown") || !Defaults[.isHideUnknownOn] {
|
||||||
|
self.tableData[tableDataIndex].item.append(TableCell(title: additionKey, content: password.additions[additionKey]!))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,4 +29,7 @@ extension DefaultsKeys {
|
||||||
|
|
||||||
static let isTouchIDOn = DefaultsKey<Bool>("isTouchIDOn")
|
static let isTouchIDOn = DefaultsKey<Bool>("isTouchIDOn")
|
||||||
static let passcodeKey = DefaultsKey<String?>("passcodeKey")
|
static let passcodeKey = DefaultsKey<String?>("passcodeKey")
|
||||||
|
|
||||||
|
static let isHideUnknownOn = DefaultsKey<Bool>("isHideUnknownOn")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>Pass</string>
|
<string>Pass for iOS</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
|
|
|
||||||
|
|
@ -57,17 +57,17 @@ class Password {
|
||||||
|
|
||||||
static func getAdditionFields(from additionFieldsPlainText: String) -> [AdditionField]{
|
static func getAdditionFields(from additionFieldsPlainText: String) -> [AdditionField]{
|
||||||
var additionFieldsArray = [AdditionField]()
|
var additionFieldsArray = [AdditionField]()
|
||||||
var unkownIndex = 0
|
var unknownIndex = 0
|
||||||
|
|
||||||
additionFieldsPlainText.enumerateLines() { line, _ in
|
additionFieldsPlainText.enumerateLines() { line, _ in
|
||||||
let items = line.characters.split(separator: ":", maxSplits: 1, omittingEmptySubsequences: true).map(String.init)
|
let items = line.characters.split(separator: ":", maxSplits: 1, omittingEmptySubsequences: true).map(String.init)
|
||||||
var key = ""
|
var key = ""
|
||||||
var value = ""
|
var value = ""
|
||||||
if items.count == 1 {
|
if items.count == 1 {
|
||||||
unkownIndex += 1
|
unknownIndex += 1
|
||||||
key = "unkown \(unkownIndex)"
|
key = "unknown \(unknownIndex)"
|
||||||
value = items[0]
|
value = items[0]
|
||||||
} else {
|
} else if items.count == 2 {
|
||||||
key = items[0]
|
key = items[0]
|
||||||
value = items[1].trimmingCharacters(in: .whitespaces)
|
value = items[1].trimmingCharacters(in: .whitespaces)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue