Skip to content

Instantly share code, notes, and snippets.

@artembolotov
Last active October 16, 2019 04:42
Show Gist options
  • Save artembolotov/504db88ba2b99b6d3dcfa3bb3447dc48 to your computer and use it in GitHub Desktop.
Save artembolotov/504db88ba2b99b6d3dcfa3bb3447dc48 to your computer and use it in GitHub Desktop.
override func draw(_ rect: CGRect) {
StyleKit.drawCheckBox(frame: rect, mainColor: .main, isChecked: isChecked)
}
extension UIColor {
static var main: UIColor {
if #available(iOS 13.0, *) {
return UIColor { (traitCollection) -> UIColor in
if traitCollection.userInterfaceStyle == .dark {
return StyleKit.appMainColorDark
}
return StyleKit.appMainColorLight
}
}
return StyleKit.appMainColorLight
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment