Skip to content

Instantly share code, notes, and snippets.

@RealEmmettS
Created September 22, 2021 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RealEmmettS/8155b11686afafe9290817978cf806c0 to your computer and use it in GitHub Desktop.
Save RealEmmettS/8155b11686afafe9290817978cf806c0 to your computer and use it in GitHub Desktop.
if <#condition#>{
if #available(iOS 13.0, *) {
UIView.transition (with: self.view, duration: 0.3, options: .transitionCrossDissolve, animations: {
self.overrideUserInterfaceStyle = .dark //.light or .unspecified
}, completion: nil)
}
}else{
if #available(iOS 13.0, *) {
UIView.transition (with: self.view, duration: 0.3, options: .transitionCrossDissolve, animations: {
self.overrideUserInterfaceStyle = .light //.light or .unspecified
}, completion: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment