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 {
|
||||
var pureBlackDarkMode: Bool {
|
||||
get {
|
||||
(value(forKey: "_clientDefinedTraits") as? [String: Any])?[key] as? Bool ?? true
|
||||
(value(forKey: "_clientDefinedTraits") as? [String: Any])?["tusker_usePureBlackDarkMode"] as? Bool ?? true
|
||||
}
|
||||
set {
|
||||
var dict = value(forKey: "_clientDefinedTraits") as? [String: Any] ?? [:]
|
||||
dict[key] = newValue
|
||||
dict["tusker_usePureBlackDarkMode"] = newValue
|
||||
setValue(dict, forKey: "_clientDefinedTraits")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue