Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwiftUI Form Number Input

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.

like image 566
Andula Avatar asked Apr 19 '26 12:04

Andula


1 Answers

    HStack {
        Text("Widths")
        TextField("", value: $input, formatter: NumberFormatter())
            .frame(width: 50)
        Stepper(value: $input, in: 1...8) {
            EmptyView()
        }
    }
like image 109
ChrisR Avatar answered Apr 22 '26 02:04

ChrisR



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!