Contents

removeFromParent()

Removes the called view controller from its parent view controller.

Declaration

func removeFromParent()

Discussion

Use this method to remove a child view controller from its parent view controller, unless you want to perform work during the removal. In that case, instead override the removeChild(at:) method to perform that work and call that method.

This is a convenience method that calls the removeChild(at:) method, automatically supplying the appropriate index value as an argument.

See Also

Managing Child View Controllers in a Custom Container