Created
December 16, 2019 04:14
-
-
Save artemnovichkov/52c2a0309ae04bb9d0b135ec0ba2e19e to your computer and use it in GitHub Desktop.
Updating layer colors with new trait collection
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
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { | |
super.traitCollectionDidChange(previousTraitCollection) | |
traitCollection.hasDifferentColorAppearance(comparedTo: traitCollection) { | |
layer.backgroundColor = UIColor.layer.cgColor | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment