Created
July 15, 2019 11:52
-
-
Save BetterProgramming/a3a5f4b261aee2667aacdc0bae9adb98 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
func createTitleColor(lightVersion : UIColor, darkVersion : UIColor)->UIColor { | |
if #available(iOS 13.0, *) { | |
let myDynamicColor = UIColor { (traitCollection: UITraitCollection) -> UIColor in if traitCollection.userInterfaceStyle == .dark { | |
return darkVersion | |
} else { | |
return lightVersion | |
} | |
} | |
return myDynamicColor | |
} else { | |
return lightVersion | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment