Utilize default settings values

This commit is contained in:
Danny Moesch 2019-05-01 18:28:22 +02:00
parent f9c19b3ca4
commit c2cd6481fd
6 changed files with 13 additions and 15 deletions

View file

@ -22,7 +22,7 @@ public extension DefaultsKeys {
static let gitURL = DefaultsKey<URL?>("gitURL")
static let gitAuthenticationMethod = DefaultsKey<String?>("gitAuthenticationMethod")
static let gitUsername = DefaultsKey<String?>("gitUsername")
static let gitBranchName = DefaultsKey<String?>("gitBranchName")
static let gitBranchName = DefaultsKey<String>("gitBranchName", defaultValue: "master")
static let gitSSHPrivateKeyURL = DefaultsKey<URL?>("gitSSHPrivateKeyURL")
static let gitSSHKeySource = DefaultsKey<String?>("gitSSHKeySource")
static let gitSSHPrivateKeyArmor = DefaultsKey<String?>("gitSSHPrivateKeyArmor")
@ -40,7 +40,7 @@ public extension DefaultsKeys {
static let isRememberGitCredentialPassphraseOn = DefaultsKey<Bool>("isRememberGitCredentialPassphraseOn", defaultValue: false)
static let isShowFolderOn = DefaultsKey<Bool>("isShowFolderOn", defaultValue: true)
static let isHidePasswordImagesOn = DefaultsKey<Bool>("isHidePasswordImagesOn", defaultValue: false)
static let isSearchDefaultAll = DefaultsKey<Bool>("isSearchDefaultAll", defaultValue: true)
static let searchDefault = DefaultsKey<SearchBarScope>("searchDefault", defaultValue: .all)
static let passwordGeneratorFlavor = DefaultsKey<String>("passwordGeneratorFlavor", defaultValue: "Apple")
static let encryptInArmored = DefaultsKey<Bool>("encryptInArmored", defaultValue: false)

View file

@ -0,0 +1,23 @@
//
// SearchBarScope.swift
// pass
//
// Created by Danny Moesch on 05.03.19.
// Copyright © 2019 Bob Sun. All rights reserved.
//
import SwiftyUserDefaults
public enum SearchBarScope: Int, CaseIterable, DefaultsSerializable {
case current
case all
public var localizedName: String {
switch self {
case .current:
return "Current".localize()
case .all:
return "All".localize()
}
}
}