Reminders and Calendar have blue and red tint color (accent color) respectively.
UIView.appearance().tintColor = .label
works. However, the .label is white in darkmode and the text-color of today's date when selected is also white. Therefore, it looks so. Use another color than .label
(white) to test it,
You can not change the text color of today's date. It is always white, I think.
You may not need to change the global tint color. If you only need to chagne the tintColor of the datepicker, do this:
datepicker.tintColor = .yourColor
does the job.
If your global tint color is .label
, use another color than .label
as the tint-color of UIDatePicker
to fix the issue.
You can also change the global tint color using one of the following method.
UIKit
You need to change the tint color of the whole App to change the tint color of UIDatePicker.
self.window?.tintColor = .primary // .red
In scene(_:willConnectTo:options:)
, use the above code
If you do not use SceneDelegate
, use the code above in application(_:didFinishLaunchingWithOptions:)
You can also change it in Storyboard.
https://stephenradford.me/quick-tip-globally-changing-tint-color-application-wide/
SwiftUI
Change accentColor in Assets.
Change global tint color - iOS7/iOS8