All I need (on iOS 8.x and 9.0) is this one line to change the font color:
[my_date_picker setValue:[UIColor whiteColor] forKey:@"textColor"];
No subclassing or invoking of private APIs...
Note: today's current date will still be highlighted (in newer iOS versions). You can get around this by using the following code:
if ([my_date_picker respondsToSelector:sel_registerName("setHighlightsToday:")]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
[my_date_picker performSelector:@selector(setHighlightsToday:) withObject:[NSNumber numberWithBool:NO]];
#pragma clang diagnostic pop
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…