Skip to content

Commit

Permalink
Rename user defaults group and add in settings bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Jun 15, 2024
1 parent c6b11f3 commit 153c851
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Keyboards/KeyboardsBase/KeyboardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ class KeyboardViewController: UIInputViewController {
func loadKeys() {
// The name of the language keyboard that's referencing KeyboardViewController.
controllerLanguage = classForCoder.description().components(separatedBy: ".KeyboardViewController")[0]
if let userDefaults = UserDefaults(suiteName: "group.scribe.userDefaultsContainer") {
if let userDefaults = UserDefaults(suiteName: "group.be.scri.userDefaultsContainer") {
if userDefaults.bool(forKey: "svAccentCharacters") {
disableAccentCharacters = true
} else {
Expand Down Expand Up @@ -2127,7 +2127,7 @@ class KeyboardViewController: UIInputViewController {

func setCommaAndPeriodKeysConditionally() {
let langCode = languagesAbbrDict[controllerLanguage] ?? "unknown"
if let userDefaults = UserDefaults(suiteName: "group.scribe.userDefaultsContainer") {
if let userDefaults = UserDefaults(suiteName: "group.be.scri.userDefaultsContainer") {
let dictionaryKey = langCode + "CommaAndPeriod"
let letterKeysHaveCommaPeriod = userDefaults.bool(forKey: dictionaryKey)

Expand All @@ -2141,7 +2141,7 @@ class KeyboardViewController: UIInputViewController {

func emojiAutosuggestIsEnabled() -> Bool {
let langCode = languagesAbbrDict[controllerLanguage] ?? "unknown"
if let userDefaults = UserDefaults(suiteName: "group.scribe.userDefaultsContainer") {
if let userDefaults = UserDefaults(suiteName: "group.be.scri.userDefaultsContainer") {
let dictionaryKey = langCode + "EmojiAutosuggest"

return userDefaults.bool(forKey: dictionaryKey)
Expand Down
2 changes: 1 addition & 1 deletion Keyboards/LanguageKeyboards/French/French.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.scribe.userDefaultsContainer</string>
<string>group.be.scri.userDefaultsContainer</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public enum GermanKeyboardConstants {

/// Gets the keys for the German keyboard.
func getDEKeys() {
let userDefaults = UserDefaults(suiteName: "group.scribe.userDefaultsContainer")!
let userDefaults = UserDefaults(suiteName: "group.be.scri.userDefaultsContainer")!

if DeviceType.isPhone {
if userDefaults.bool(forKey: "deAccentCharacters") {
Expand Down
2 changes: 1 addition & 1 deletion Keyboards/LanguageKeyboards/German/German.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.scribe.userDefaultsContainer</string>
<string>group.be.scri.userDefaultsContainer</string>
</array>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Keyboards/LanguageKeyboards/Italian/Italian.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.scribe.userDefaultsContainer</string>
<string>group.be.scri.userDefaultsContainer</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.scribe.userDefaultsContainer</string>
<string>group.be.scri.userDefaultsContainer</string>
</array>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Keyboards/LanguageKeyboards/Russian/Russian.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.scribe.userDefaultsContainer</string>
<string>group.be.scri.userDefaultsContainer</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public enum SpanishKeyboardConstants {

/// Gets the keys for the Spanish keyboard.
func getESKeys() {
let userDefaults = UserDefaults(suiteName: "group.scribe.userDefaultsContainer")!
let userDefaults = UserDefaults(suiteName: "group.be.scri.userDefaultsContainer")!

if DeviceType.isPhone {
if userDefaults.bool(forKey: "esAccentCharacters") {
Expand Down
2 changes: 1 addition & 1 deletion Keyboards/LanguageKeyboards/Spanish/Spanish.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.scribe.userDefaultsContainer</string>
<string>group.be.scri.userDefaultsContainer</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public enum SwedishKeyboardConstants {

/// Gets the keys for the Swedish keyboard.
func getSVKeys() {
let userDefaults = UserDefaults(suiteName: "group.scribe.userDefaultsContainer")!
let userDefaults = UserDefaults(suiteName: "group.be.scri.userDefaultsContainer")!

if DeviceType.isPhone {
if userDefaults.bool(forKey: "svAccentCharacters") {
Expand Down
2 changes: 1 addition & 1 deletion Keyboards/LanguageKeyboards/Swedish/Swedish.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.scribe.userDefaultsContainer</string>
<string>group.be.scri.userDefaultsContainer</string>
</array>
</dict>
</plist>
29 changes: 28 additions & 1 deletion Scribe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,18 @@
D180EC0928FDFABF0018E29B /* FR-AZERTYInterfaceVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = D180EC0228FDFABF0018E29B /* FR-AZERTYInterfaceVariables.swift */; };
D180EC0A28FDFABF0018E29B /* FR-AZERTYInterfaceVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = D180EC0228FDFABF0018E29B /* FR-AZERTYInterfaceVariables.swift */; };
D180EC0B28FDFABF0018E29B /* FR-AZERTYInterfaceVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = D180EC0228FDFABF0018E29B /* FR-AZERTYInterfaceVariables.swift */; };
D1895BD22C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D1895BD32C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D1895BD42C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D1895BD52C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D1895BD62C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D1895BD72C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D1895BD82C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D1895BD92C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D1895BDA2C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D1895BDB2C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D1895BDC2C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D1895BDD2C1D816F009FBEB0 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1895BD12C1D816F009FBEB0 /* Settings.bundle */; };
D18EA89C2760D4A6001E1358 /* SVKeyboardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D18EA89B2760D4A6001E1358 /* SVKeyboardViewController.swift */; };
D18EA8A02760D4A6001E1358 /* Swedish.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = D18EA8992760D4A6001E1358 /* Swedish.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
D18EA8A42760D6EE001E1358 /* Keyboard.xib in Resources */ = {isa = PBXBuildFile; fileRef = D1C0ACD92719E0AA001E11C3 /* Keyboard.xib */; };
Expand Down Expand Up @@ -943,6 +955,7 @@
D174F8A22756893200DCE106 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; };
D17693DC28FC8CC300DF0FBB /* FR-QWERTYInterfaceVariables.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FR-QWERTYInterfaceVariables.swift"; sourceTree = "<group>"; };
D180EC0228FDFABF0018E29B /* FR-AZERTYInterfaceVariables.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FR-AZERTYInterfaceVariables.swift"; sourceTree = "<group>"; };
D1895BD12C1D816F009FBEB0 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
D18EA8992760D4A6001E1358 /* Swedish.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = Swedish.appex; sourceTree = BUILT_PRODUCTS_DIR; };
D18EA89B2760D4A6001E1358 /* SVKeyboardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SVKeyboardViewController.swift; sourceTree = "<group>"; };
D18EA89D2760D4A6001E1358 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1582,6 +1595,7 @@
isa = PBXGroup;
children = (
EDB4601A2AF9FD8200BEA967 /* Localizable.xcstrings */,
D1895BD12C1D816F009FBEB0 /* Settings.bundle */,
);
path = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -1941,6 +1955,7 @@
buildActionMask = 2147483647;
files = (
D198B5D82BFA954100E1BF4F /* LICENSE.txt in Resources */,
D1895BD22C1D816F009FBEB0 /* Settings.bundle in Resources */,
D198B5D72BFA954100E1BF4F /* .gitignore in Resources */,
38BD214122D5908100C6795D /* LaunchScreen.storyboard in Resources */,
D198B5D22BFA954100E1BF4F /* en-US.json in Resources */,
Expand All @@ -1965,6 +1980,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D1895BD62C1D816F009FBEB0 /* Settings.bundle in Resources */,
CE2C606928FC4DB1005FDAA1 /* Assets.xcassets in Resources */,
D15E298229E41B56006B2C81 /* DELanguageData.sqlite in Resources */,
D1C0ACDA2719E0AA001E11C3 /* Keyboard.xib in Resources */,
Expand All @@ -1975,6 +1991,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D1895BD52C1D816F009FBEB0 /* Settings.bundle in Resources */,
D109A22B275B6A8B005E2271 /* Keyboard.xib in Resources */,
CE2C606828FC4DB0005FDAA1 /* Assets.xcassets in Resources */,
D15E297F29E41B3B006B2C81 /* FRLanguageData.sqlite in Resources */,
Expand All @@ -1985,6 +2002,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D1895BDA2C1D816F009FBEB0 /* Settings.bundle in Resources */,
D109A231275B6A8C005E2271 /* Keyboard.xib in Resources */,
D15E298629E41B8F006B2C81 /* PTLanguageData.sqlite in Resources */,
CE2C606B28FC4DB3005FDAA1 /* Assets.xcassets in Resources */,
Expand All @@ -1995,6 +2013,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D1895BDC2C1D816F009FBEB0 /* Settings.bundle in Resources */,
CE2C606D28FC4DB4005FDAA1 /* Assets.xcassets in Resources */,
D190B2582742525C00705659 /* Keyboard.xib in Resources */,
D15E298A29E41BAD006B2C81 /* ESLanguageData.sqlite in Resources */,
Expand All @@ -2005,6 +2024,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D1895BDB2C1D816F009FBEB0 /* Settings.bundle in Resources */,
D15E298829E41BA1006B2C81 /* RULanguageData.sqlite in Resources */,
D1671A74275A1FC000A7C118 /* Keyboard.xib in Resources */,
CE2C606C28FC4DB3005FDAA1 /* Assets.xcassets in Resources */,
Expand All @@ -2015,6 +2035,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D1895BDD2C1D816F009FBEB0 /* Settings.bundle in Resources */,
D15E298C29E41BBE006B2C81 /* SVLanguageData.sqlite in Resources */,
D18EA8A42760D6EE001E1358 /* Keyboard.xib in Resources */,
CE2C606E28FC4DB4005FDAA1 /* Assets.xcassets in Resources */,
Expand All @@ -2026,6 +2047,7 @@
buildActionMask = 2147483647;
files = (
D1AB5B5629C757A100CCB0C1 /* Keyboard.xib in Resources */,
D1895BD92C1D816F009FBEB0 /* Settings.bundle in Resources */,
D1AB5B5929C757A100CCB0C1 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -2035,6 +2057,7 @@
buildActionMask = 2147483647;
files = (
D1AFDF3429CA66D00033BF27 /* Keyboard.xib in Resources */,
D1895BD42C1D816F009FBEB0 /* Settings.bundle in Resources */,
D1AFDF3729CA66D00033BF27 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -2044,6 +2067,7 @@
buildActionMask = 2147483647;
files = (
D1AFDFB129CA66F40033BF27 /* Keyboard.xib in Resources */,
D1895BD32C1D816F009FBEB0 /* Settings.bundle in Resources */,
D1AFDFB429CA66F40033BF27 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -2053,6 +2077,7 @@
buildActionMask = 2147483647;
files = (
D1AFE00729CA6E900033BF27 /* Keyboard.xib in Resources */,
D1895BD72C1D816F009FBEB0 /* Settings.bundle in Resources */,
D1AFE00A29CA6E900033BF27 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -2061,6 +2086,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D1895BD82C1D816F009FBEB0 /* Settings.bundle in Resources */,
D1B81D4127BBB70E0085FE5E /* Keyboard.xib in Resources */,
D15E298429E41B74006B2C81 /* ITLanguageData.sqlite in Resources */,
CE2C606A28FC4DB2005FDAA1 /* Assets.xcassets in Resources */,
Expand Down Expand Up @@ -3115,7 +3141,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = CJJ59NJ7J8;
DEVELOPMENT_TEAM = ATJ9U3WZ27;
INFOPLIST_FILE = "$(SRCROOT)/Keyboards/LanguageKeyboards/German/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "Deutsch (Scribe)";
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
Expand Down Expand Up @@ -3217,6 +3243,7 @@
MARKETING_VERSION = 3.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.scribe.french;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ final class InfoChildTableViewCell: UITableViewCell {
}
}

let userDefaults = UserDefaults(suiteName: "group.scribe.userDefaultsContainer")!
let userDefaults = UserDefaults(suiteName: "group.be.scri.userDefaultsContainer")!

var languageCode: String {
guard let parentSection = parentSection,
Expand Down
10 changes: 10 additions & 0 deletions Scribe/Resources/Settings.bundle/Root.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>StringsTable</key>
<string>Root</string>
<key>PreferenceSpecifiers</key>
<array/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Scribe/Scribe.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.scribe.userDefaultsContainer</string>
<string>group.be.scri.userDefaultsContainer</string>
</array>
</dict>
</plist>

0 comments on commit 153c851

Please sign in to comment.