Last active
December 25, 2022 12:30
-
-
Save artemnovichkov/659a520570d2d276e7140947f77d6c41 to your computer and use it in GitHub Desktop.
Saving UIUserInterfaceStyle to UserDefaults
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension UserDefaults { | |
var overridedUserInterfaceStyle: UIUserInterfaceStyle { | |
get { | |
UIUserInterfaceStyle(rawValue: integer(forKey: #function)) ?? .unspecified | |
} | |
set { | |
set(newValue.rawValue, forKey: #function) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment