dark mode change immediately swift
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else {
return
}
appDelegate.changeTheme(themeVal)
// App Delegate Change Theme method
func changeTheme(themeVal: String) {
if #available(iOS 13.0, *) {
switch themeVal {
case "dark":
window?.overrideUserInterfaceStyle = .dark
break
case "light":
window?.overrideUserInterfaceStyle = .light
break
default:
window?.overrideUserInterfaceStyle = .unspecified
}
}
}
Also in Swift:
- swift how to call a function
- remove all add TapGestureRecognizer swift
- how to loop swift
- changing color of background swift
- loop key value swift
- swift - salesforce chat only
- pop the view controller xcode
- swift store enum case string values in firebase
- xcode cannot find uiimagepickercontrolleroriginalimage in scope
- how to set the center in view in swift
- swift variable in a string
- swift access appdelegate from viewcontroller
- convert secondsfrom1970 to date swift
- swift allow gesture recognizer over others
- xcode disable a button
- create dictionary swift
- swift generate uuid
- uilabel font size swift
- number of characters in a string swift
- how to get index path cell collection view from ui longpress gesture swift
- get height of navigation bar swift
- blur background swiftui
- disable trailing swipe action swift
- swift check dictionary has key