Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. let myDynamicColor = UIColor { (traitCollection: UITraitCollection) -> UIColor in
  2. switch traitCollection.userInterfaceStyle {
  3. case .unspecified, .light: return UIColor(red: 220, green: 220, blue: 220, alpha: 1.0)
  4. case .dark: return UIColor(red: 0, green: 0, blue: 0, alpha: 1.0)
  5. }
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement