I'm stuck on a problem with SwiftUI. I need to color all the letters red and all the numbers black in a TextField while the user is typing them.
Let's say I have this code
TextField(
"A99",
text: $viewModel.code
)
.padding([.trailing])
.multilineTextAlignment(.trailing)
How would I achieve my goal of colouring while the user types?
I'm pretty new to iOS development, also new to SwiftUi and never really used UIKit, so the answer might be obvious but I couldn't find one.