[ios] Adding setting to change map appearance

Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
Yannik Bloscheck
2025-07-21 13:26:50 +02:00
committed by Yannik Bloscheck
parent e7cdaba817
commit 110648fb89
5 changed files with 62 additions and 6 deletions

View File

@@ -12,6 +12,10 @@ import Combine
static private let userDefaultsKeyLeftButtonType = "LeftButtonType"
/// Key for storing the map appearance in the user defaults
static private let userDefaultsKeyMapAppearance = "MapAppearance"
/// The current distance unit
static var distanceUnit: DistanceUnit {
get {
@@ -147,6 +151,23 @@ import Combine
}
/// The current map appearance
@objc static var mapAppearance: Appearance {
get {
let mapAppearanceRawValue = UserDefaults.standard.integer(forKey: userDefaultsKeyMapAppearance)
if mapAppearanceRawValue != 0, let mapAppearance = Appearance(rawValue: mapAppearanceRawValue) {
return mapAppearance
}
return .auto
}
set {
UserDefaults.standard.set(newValue.rawValue, forKey: userDefaultsKeyMapAppearance)
ThemeManager.invalidate()
}
}
/// The current appearance
@objc static var appearance: Appearance {
get {