I am creating night mode using Swift 4.2(Notification Center ). I followed https://medium.com/@mczachurski/ios-dark-theme-9a12724c112d this tutorial and able change the colour for only labels. check the below list what all things need to change after changing the mode.
- Navigation bar
- Collection view cell images
- Custom cell(.xib) background color
see the below functions
override func enableDarkMode() {
super.enableDarkMode()
let navigationBarAppearace = UINavigationBar.appearance()
navigationBarAppearace.tintColor = UIColor.black
navigationBarAppearace.barTintColor = UIColor.black
}
override func enableDarkMode() {
super.enableDarkMode()
let navigationBarAppearace = UINavigationBar.appearance()
navigationBarAppearace.tintColor = UIColor.black
navigationBarAppearace.barTintColor = UIColor.black
}