Instance Method

initWithArrangedSubviews:

Returns a new stack view object that manages the provided views.

Declaration

- (instancetype)initWithArrangedSubviews:(NSArray<__kindof UIView *> *)views;

Parameters

views

The views to be arranged by the stack view.

Return Value

A new stack view object. This stack view contains and lays out the provided views in a single stack. You can modify the orientation or appearance of this stack, using the stack view’s properties.

Discussion

The stack view adds all the arranged views to its arrangedSubviews array. It also adds these views as subviews. If any view contained in the arrangedSubviews array receives a removeFromSuperview method call, the stack view also removes it from the arrangedSubviews.

See Also

Initializing a Stack View

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software