-
Notifications
You must be signed in to change notification settings - Fork 398
Expand file tree
/
Copy pathUserDefaults.swift
More file actions
29 lines (25 loc) · 879 Bytes
/
UserDefaults.swift
File metadata and controls
29 lines (25 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
// UserDefaults.swift
// Postgres
//
// Created by Jakob Egger on 27.10.16.
// Copyright © 2016 postgresapp. All rights reserved.
//
import Cocoa
extension UserDefaults {
// @nonobjc is necessary to prevent the following compiler error (which might be a bug):
// A declaration cannot be both 'final' and 'dynamic'
@nonobjc static var shared: UserDefaults = {
let sharedDefaults = Bundle.main.bundleIdentifier == "com.postgresapp.Postgres2" ? UserDefaults.standard : UserDefaults(suiteName: "com.postgresapp.Postgres2")!
sharedDefaults.registerPostgresDefaults()
return sharedDefaults
}()
func registerPostgresDefaults() {
self.register(defaults: [
"ClientAppName": "Terminal",
"StartLoginHelper": true,
Self.PermissionDialogForTrustAuthKey: true,
])
}
static let PermissionDialogForTrustAuthKey = "PermissionDialogForTrustAuth"
}