SwiftUI · Slider & Stepper | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4001741-swiftui/lessons/9

Hi there,

I am a beginner in terms of using developer documentation. I’d like to ask you about the following lines:
Stepper(“Set the order amount”, value: $orderCount)

I looked at the Stepper component in the dev doc and did not find any initialiser that only takes two argument. My question is where did you see this or how do you know that you can initialise a Stepper component like this? Obviously it is a simplest initialiser. How would you know you can initialise Stepper like this and it will increase and decrease the value bound to that component by 1. THere is no function or closure attached.
Screenshot 2020-05-28 at 11.23.10

Many thanks!

Sorry for this question. I noticed that way of initialising a Stepper is offered by Xcode autocompletion.
Why is that not in dev dov then? Thanks

@noah8610 - I found it by experimenting! Remember SwiftUI is still a fresh technology and Apple will take time to update documentation for the API. You’re doing a great job!