diff --git a/godtools/App/Share/Common/SharedAppleExtensions/Foundation/Collection/Collection+SafeLookup.swift b/godtools/App/Share/Common/SharedAppleExtensions/Foundation/Collection/Collection+SafeLookup.swift index 8c3bd31bb7..9a167f4397 100644 --- a/godtools/App/Share/Common/SharedAppleExtensions/Foundation/Collection/Collection+SafeLookup.swift +++ b/godtools/App/Share/Common/SharedAppleExtensions/Foundation/Collection/Collection+SafeLookup.swift @@ -10,7 +10,7 @@ import Foundation extension Collection where Indices.Iterator.Element == Index { - subscript (safe index: Index) -> Iterator.Element? { + public subscript (safe index: Index) -> Iterator.Element? { return indices.contains(index) ? self[index] : nil } } diff --git a/godtools/App/Share/Common/SharedAppleExtensions/Foundation/Locale/Locale+Extensions.swift b/godtools/App/Share/Common/SharedAppleExtensions/Foundation/Locale/Locale+Extensions.swift index 3c21ca02ab..2b4b2fb718 100644 --- a/godtools/App/Share/Common/SharedAppleExtensions/Foundation/Locale/Locale+Extensions.swift +++ b/godtools/App/Share/Common/SharedAppleExtensions/Foundation/Locale/Locale+Extensions.swift @@ -10,22 +10,22 @@ import Foundation extension Locale { - var isBaseLanguage: Bool { + public var isBaseLanguage: Bool { let isBaseLanguage: Bool = isMissingRegionCode && isMissingScriptCode return isBaseLanguage } - var isEnglishLanguage: Bool { + public var isEnglishLanguage: Bool { return languageCode == "en" } - var isMissingRegionCode: Bool { + public var isMissingRegionCode: Bool { return regionCode?.isEmpty ?? true } - var isMissingScriptCode: Bool { + public var isMissingScriptCode: Bool { return scriptCode?.isEmpty ?? true } @@ -43,15 +43,15 @@ extension Locale { return languageCodesMatch } - func scriptCodeIsEqualToLocaleScriptCode(locale: Locale) -> Bool { + public func scriptCodeIsEqualToLocaleScriptCode(locale: Locale) -> Bool { return locale.scriptCode?.lowercased() == scriptCode?.lowercased() } - func regionCodeIsEqualToLocaleRegionCode(locale: Locale) -> Bool { + public func regionCodeIsEqualToLocaleRegionCode(locale: Locale) -> Bool { return locale.regionCode?.lowercased() == regionCode?.lowercased() } - func isEqualTo(locale: Locale) -> Bool { + public func isEqualTo(locale: Locale) -> Bool { let languageCodesMatch: Bool = languageCodeIsEqualToLocaleLanguageCode(locale: locale) let scriptCodesMatch: Bool = scriptCodeIsEqualToLocaleScriptCode(locale: locale) @@ -60,12 +60,12 @@ extension Locale { return languageCodesMatch && scriptCodesMatch && regionCodesMatch } - func baseLanguageIsEqualToLocaleBaseLanguage(locale: Locale) -> Bool { + public func baseLanguageIsEqualToLocaleBaseLanguage(locale: Locale) -> Bool { return languageCodeIsEqualToLocaleLanguageCode(locale: locale) } - func baseLanguageAndScriptCodesAreEqualTo(locale: Locale) -> Bool { + public func baseLanguageAndScriptCodesAreEqualTo(locale: Locale) -> Bool { let baseLanguagesMatch: Bool = baseLanguageIsEqualToLocaleBaseLanguage(locale: locale) let scriptCodesMatch: Bool = locale.scriptCode?.lowercased() == scriptCode?.lowercased()