Home > Mobile >  SwiftUI Form Number Input
SwiftUI Form Number Input

Time:02-25

I was wondering if there is a predefined number input in SwiftUI for macOS which looks like this:

swiftui number input

It is a casual Apple number input consisting of both the TextField and two increase and decrease buttons.

CodePudding user response:

    HStack {
        Text("Widths")
        TextField("", value: $input, formatter: NumberFormatter())
            .frame(width: 50)
        Stepper(value: $input, in: 1...8) {
            EmptyView()
        }
    }
  • Related