uliwitness, Hey, is there any way to add a range check to a SwiftUI TextField?
I have an
struct MyView: View {
@ State var intValue: UInt16var body: some View {
TextField("UInt16”, value: $intValue, format: .number)
}
}and if I enter “-1” or “65537” into the text field, it calls fatalError() trying to convert the user-entered text into a UInt16, and I'd rather it just beep than crash the app on invalid user input.