Instance Method


Tells the view that a subview is about to be removed.


func willRemoveSubview(_ subview: UIView)



The subview that will be removed.


The default implementation of this method does nothing. Subclasses can override it to perform additional actions whenever subviews are removed. This method is called when the subview’s superview changes or when the subview is removed from the view hierarchy completely.

See Also

Related Symbols

func removeFromSuperview()

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

func didAddSubview(UIView)

Tells the view that a subview was added.