0

How would I go about changing the color of the text in a UIDatePicker? I would prefer not to use UIPickerView as I don't want to deal with the implementation of the date/time aspect of it, however, if there exists a prewritten implementation of the equivalent of a UIDatePicker as a UIPickerView, I would be open to it.

Note, I am using Swift 5.

  • Does this answer your question? [Set text color for UIDatePicker in Swift](https://stackoverflow.com/questions/38972197/set-text-color-for-uidatepicker-in-swift) – byaruhaf Dec 26 '19 at 03:19

1 Answers1

1
Still Works, Swift 5 Update
  datePicker.setValue(UIColor.white, forKeyPath: "textColor") 

This works for me.

datePicker.setValue(UIColor.whiteColor(), forKeyPath: "textColor")
Ankur Purwar
  • 275
  • 2
  • 9