insertChild(_:at:)
Inserts a specified child view controller into the Children array at a specified position.
Declaration
func insertChild(_ childViewController: NSViewController, at index: Int)Parameters
Discussion
You should instead use the addChild(_:) method unless you want to perform work on child view controllers as you add them. In that case, override this method to perform that work.
If a child view controller has a different parent when you call this method, the child is first be removed from its existing parent by calling the child’s removeFromParent() method.