Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

disable dark mode swift

      if #available(iOS 13.0, *) {
          UIWindow.appearance().overrideUserInterfaceStyle = .light
      }
Comment

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
     }
  }
}
Comment

PREVIOUS NEXT
Code Example
Swift :: array length swift 
Swift :: swift play audio stream from url 
Swift :: swift javascript injection 
Swift :: convert data to json swift 
Swift :: swift 5 make a phone call 
Swift :: xcode disable a button 
Swift :: swift dispatch after 
Swift :: swift test if simulator 
Swift :: swift date plus1 day 
Swift :: textchange in textview swift 
Swift :: Make a VStack fill the width of the screen in SwiftUI 
Swift :: and in swift6 
Swift :: convert dictionary to array swift 
Swift :: swift string concatenation 
Swift :: display image from url swift 
Swift :: changing color of background swift 
Swift :: for loop swift 
Swift :: Swift Closure That Returns Value 
Swift :: rounded ios button 
Swift :: case insensitive multiple word search swift 
Swift :: how to show notification icon on tabbar item swift 
Swift :: swift replace newlines with space 
Swift :: swift enum xib 
Swift :: share local storage wkwebview swift 
Swift :: swift combine 2 sets 
Swift :: how to screen record swift stackoverflow 
Swift :: async await apis for ios 13 
Swift :: Rules for naming Swift Variables 
Swift :: how to check if not running in debufgger swift 
Swift :: called a function after some time in swift 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =