@rooster has the right answer.
May I add to it?
I have written before of thinking of ForEach as a view factory. See -> ViewFactory
In that write-up, when using a ForEach I challenge you ask yourself three questions.
- What is the collection of things is this processing?
- What makes each thing unique? A UUID? A barcode? Song's name?
- What is the ForEach factory making?
In your case the answers are:
- A range of integers.
- The integer itself is unique.
- The ForEach factory is making Text views containing a text version of the integer.
You have to click on ONE of the elements in the Picker, and the picker has to decide what value to shove INTO the selection value.
So if your picker makes 11 text views (2 through 12), what is the selection value if you tap on the Text view displaying a 4 ?
You SEE the number 4, but there is no value associated with this Text view! Consequently, the Picker view falls back on the ordered number of the element. And as @rooster noted, the array is zero based. The first text box [2] is the zero element. [3] is the 1 element, and then Text box [4] is the 2 element.
So if you click on the Text view showing the number 4, the picker registers that you've selected element 2.