Instance Method

setSelectedItemIndex(_:)

Selects the specified item in the list.

Declaration

func setSelectedItemIndex(_ itemIndex: Int)

Parameters

itemIndex

The index of the item to select. This index represents the index into the array of items you set using the setItems(_:) method.

Discussion

If the value in itemIndex exceeds the number of items in the array, the picker selects the last item. If itemIndex is negative, the picker selects the first item in the array.