forked from PostgresApp/PostgresApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
33 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// 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"]) | ||
} | ||
} |