Adds the provided view to the array of arranged subviews at the specified index.
- iOS 9.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The view to be added to the array of views arranged by the stack.
If index is already occupied, the stack view increases the size of the
arranged array and shifts all of its contents at the index and above to the next higher space in the array. Then the stack view stores the provided view at the index.
The stack view also ensures that the
arranged array is always a subset of its
subviews array. This method automatically adds the provided view as a subview of the stack view, if it is not already. When adding subviews, the stack view appends the view to the end of its
subviews array. The index only affects the order of views in the
arranged array. It does not affect the ordering of views in the