---
title: "addArrangedSubview(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uistackview/addarrangedsubview(_:)"
---

# addArrangedSubview(_:)

Adds a view to the end of the arranged subviews array.

## Declaration

```swift
func addArrangedSubview(_ view: UIView)
```

## Parameters

- `view`: The view to add to the array of views arranged by the stack.

## Discussion

Discussion The stack view ensures that the arrangedSubviews 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 isn’t already. If the view is already a subview, this operation doesn’t alter the subview ordering.

## See Also

### Related Documentation

- [removeFromSuperview()](uikit/uiview/removefromsuperview().md)
- [init(arrangedSubviews:)](uikit/uistackview/init(arrangedsubviews:).md)

### Managing arranged subviews

- [arrangedSubviews](uikit/uistackview/arrangedsubviews.md)
- [insertArrangedSubview(_:at:)](uikit/uistackview/insertarrangedsubview(_:at:).md)
- [removeArrangedSubview(_:)](uikit/uistackview/removearrangedsubview(_:).md)
