Contents

exchangeSubview(at:withSubviewAt:)

Exchanges the subviews at the specified indices.

Declaration

func exchangeSubview(at index1: Int, withSubviewAt index2: Int)

Parameters

  • index1:

    The index of the first subview in the receiver.

  • index2:

    The index of the second subview in the receiver.

Discussion

Each index represents the position of the corresponding view in the array in the subviews property. Subview indices start at 0 and cannot be greater than the number of subviews. This method does not change the superview of either view but simply swaps their positions in the subviews array.

See Also

Managing the view hierarchy