Created
July 15, 2019 11:50
-
-
Save BetterProgramming/d23744763a91f833b11763f32e43c728 to your computer and use it in GitHub Desktop.
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
let myDynamicColor = UIColor { (traitCollection: UITraitCollection) -> UIColor in | |
if traitCollection.userInterfaceStyle == .dark { | |
return UIColor(red: 0, green: 0, blue: 0, alpha: 1.0) | |
} else { | |
return UIColor(red: 220, green: 220, blue: 220, alpha: 1.0) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment