Skip to content

Instantly share code, notes, and snippets.

Avatar
📱
hello

Daniel Budyński Budyn

📱
hello
View GitHub Profile
@Budyn
Budyn / UIColor+System.swift
Last active Jan 30, 2020
Dynamic colors in Swift. Use it for dark mode.
View UIColor+System.swift
extension UIColor {
static func system(light: UIColor, dark: UIColor) -> UIColor {
guard #available(iOS 13, *) else { return light }
return UIColor { traits in
switch traits.userInterfaceStyle {
case .dark: return dark
case .light: return light
case .unspecified: return light
You can’t perform that action at this time.