Instance Property

isHidden

A Boolean value that determines whether the view is hidden.

Declaration

var isHidden: Bool { get set }

Discussion

Setting the value of this property to true hides the receiver and setting it to false shows the receiver. The default value is false.

A hidden view disappears from its window and does not receive input events. It remains in its superview’s list of subviews, however, and participates in autoresizing as usual. Hiding a view with subviews has the effect of hiding those subviews and any view descendants they might have. This effect is implicit and does not alter the hidden state of the receiver’s descendants.

Hiding the view that is the window’s current first responder causes the view’s next valid key view to become the new first responder.

The value of this property reflects the state of the receiver only and does not account for the state of the receiver’s ancestors in the view hierarchy. Thus this property can be false but the receiver may still be hidden if an ancestor is hidden.