Skip to content

Instantly share code, notes, and snippets.

@georrgee
Last active July 8, 2020 05:53
Show Gist options
  • Save georrgee/dd6b81f5c39602b6c2d8e3a52ec9df41 to your computer and use it in GitHub Desktop.
Save georrgee/dd6b81f5c39602b6c2d8e3a52ec9df41 to your computer and use it in GitHub Desktop.
For Dark Mode Medium Article
import UIKit
// ViewController.swift
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//view.backgroundColor = .systemRed
view.backgroundColor = CustomColor.customBackgroundColor
}
}
// ----------------------------------------------------------------
// Constants.swift
enum CustomColor {
static let customBackgroundColor = UIColor(named: "BackgroundColor")
static let customButtonColor = UIColor(named: "ButtonBackgroundColor")
static let customLabelColor = UIColor(named: "LabelColor")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment