Created
February 21, 2020 10:59
-
-
Save AlexandrFadeev/e6cd4d6a0c5d04432c529e7536b637b7 to your computer and use it in GitHub Desktop.
Dynamic color in code
This file contains hidden or 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 dynamicColor = UIColor { (traitCollection: UITraitCollection) -> UIColor in | |
if traitCollection.userInterfaceStyle == .dark { | |
return .black | |
} else { | |
return .white | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment