I have a very simple page in my storyboard to create/edit a note. It's a basic ViewController, and the only content of the view is a UITextField for the title of the note, and a UITextView for the body of it, positioned right below.
Both the body field and the title field use the default label color, as well as the default white background (which should switch to black in dark mode). I'm completely lost as to why the UITextField does not switch automatically. Am I missing something about these elements? Screenshot below:
The default value of this property is UIUserInterfaceStyle.unspecified, which causes the view to inherit the interface style from a parent view or view controller. If you assign a different value, the new style applies to the view and all of the subviews owned by the same view controller.
if #available(iOS 13.0, *) {
txtUsername.overrideUserInterfaceStyle = .light
} else {
// Fallback on earlier versions
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With