Change UIDatePicker selected Date text Color for Dark mode (iOS 13)
You can resolve this problem via Info.plist file. Add "UIUserInterfaceStyle" key and "Light" value in Info.plist file.
<key>UIUserInterfaceStyle</key>
<string>Light</string>
Reference: https://github.com/xgfe/react-native-datepicker/issues/365#issuecomment-532875809
I found something that solves the problem in a way. If I mark 'hightlightsToday' color to false, then the selected text shows with the color you set your code.
self.datePicker.setValue(false, forKey: "highlightsToday")
But if I wanted to highlight my selected date text color with a different color; in that case not sure which key value I have to change. So I am going to leave the question open, incase anyone knows how to change the selected date text color for dark mode.
You can set self.window
inside AppDelegate.m
and override Interface style like so
if (@available(iOS 13, *)) {
self.window.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
}
return YES;
Swift 5.*
if #available(iOS 13.0, *) {
self.window?.overrideUserInterfaceStyle = .light
}