Instance Property

subviews

The receiver’s immediate subviews.

Declaration

var subviews: [UIView] { get }

Discussion

You can use this property to retrieve the subviews associated with your custom view hierarchies. The order of the subviews in the array reflects their visible order on the screen, with the view at index 0 being the back-most view.

For complex views declared in UIKit and other system frameworks, any subviews of the view are generally considered private and subject to change at any time. Therefore, you should not attempt to retrieve or modify subviews for these types of system-supplied views. If you do, your code may break during a future system update.

See Also

Related Symbols

func removeFromSuperview()

Unlinks the view from its superview and its window, and removes it from the responder chain.

var superview: UIView?

The receiver’s superview, or nil if it has none.