Skip to content

Instantly share code, notes, and snippets.

@sgl0v
Created October 6, 2019 15:31
Show Gist options
  • Save sgl0v/7c26480df00fe0bcea089342b00b1c16 to your computer and use it in GitHub Desktop.
Save sgl0v/7c26480df00fe0bcea089342b00b1c16 to your computer and use it in GitHub Desktop.
Backward compatible Dark Mode on iOS - Theme_iOS13.swift
struct Theme {
static let light = Theme(type: .light, colors: .light)
static let dark = Theme(type: .dark, colors: .dark)
@available(iOS 13.0, *)
static let adaptive = Theme(type: .adaptive, colors: .adaptive)
enum `Type` {
case light
case dark
@available(iOS 13.0, *)
case adaptive
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment