objective c - Override Swift UIColor Class Functions -


i'm trying implement "dark" mode feature ios application in swift 1.2 , thinking writing extension or subclass of uicolor. wondering if it's possible override uicolor.whitecolor(), uicolor.blackcolor(), , other built-in colors. if not, what's better way accomplish dark mode entire app? following code doesn't work extension.

class func whitecolor() -> uicolor {     return uicolor(...) } 

because conflicts existing declaration of whitecolor() in uicolor.

thank you!

the best solution write colorscheme class stores colors (say labelcolor, backgroundcolor, ...). when change colorscheme "dark mode", set new colors , push nsnotification. view controller(s) should listen , set colors labels, background, etc. new values.


Comments