Completed Dark/Light Mode

This commit is contained in:
Dallon Archibald
2021-01-26 16:02:25 -05:00
parent e5772a9705
commit b41c95320e
2 changed files with 15 additions and 1 deletions
+12 -1
View File
@@ -10,6 +10,9 @@ import UserNotifications
class DebugViewController: UIViewController
{
@IBOutlet weak var userModeButton: UIButton!
var darkMode = false
override func viewDidLoad()
{
super.viewDidLoad()
@@ -45,6 +48,14 @@ class DebugViewController: UIViewController
}
@IBAction func switchViewingMode(_ sender: Any) {
view.window?.overrideUserInterfaceStyle = .dark
if !darkMode {
view.window?.overrideUserInterfaceStyle = .dark
userModeButton.setTitle("Switch to Light Mode", for: .normal)
darkMode = true
} else {
view.window?.overrideUserInterfaceStyle = .light
userModeButton.setTitle("Switch to Dark Mode", for: .normal)
darkMode = false
}
}
}