Skip to content

Instantly share code, notes, and snippets.

@mukyasa
Created May 2, 2020 04:11
Show Gist options
  • Save mukyasa/5251a50887e74168b7ab38262cca9445 to your computer and use it in GitHub Desktop.
Save mukyasa/5251a50887e74168b7ab38262cca9445 to your computer and use it in GitHub Desktop.
protocol ThemeProtocol {
func addThemeChangeObserver()
func configureSubviewsColors()
}
extension ThemeProtocol {
func addThemeChangeObserver() {
if #available(iOS 13, *) {
} else {
NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: "themeChange"),
object: nil,
queue: OperationQueue.main) { _ in
self.configureSubviewsColors()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment