Fix undefined key in Theming iOS Apps
This commit is contained in:
parent
a73c9a6cf4
commit
80bc331721
|
@ -30,11 +30,11 @@ With a simple extension on `UITraitCollection`, you can make it look like any ot
|
||||||
extension UITraitCollection {
|
extension UITraitCollection {
|
||||||
var pureBlackDarkMode: Bool {
|
var pureBlackDarkMode: Bool {
|
||||||
get {
|
get {
|
||||||
(value(forKey: "_clientDefinedTraits") as? [String: Any])?[key] as? Bool ?? true
|
(value(forKey: "_clientDefinedTraits") as? [String: Any])?["tusker_usePureBlackDarkMode"] as? Bool ?? true
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
var dict = value(forKey: "_clientDefinedTraits") as? [String: Any] ?? [:]
|
var dict = value(forKey: "_clientDefinedTraits") as? [String: Any] ?? [:]
|
||||||
dict[key] = newValue
|
dict["tusker_usePureBlackDarkMode"] = newValue
|
||||||
setValue(dict, forKey: "_clientDefinedTraits")
|
setValue(dict, forKey: "_clientDefinedTraits")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue