class TestPlatfromViewController: UIViewController {
var webVC: MyViewController!
override func viewDidLoad() {
tremendous.viewDidLoad()
view.backgroundColor = .grey
webVC = MyViewController()
view.addSubview(webVC.view)
}
}
I pushed a TestPlatfromViewController, and add MyViewController.view to self.view
MyViewController’s viewWillAppear&viewDidAppear is NOT referred to as
however MyViewController’s viewWillDisappear&viewDidDisappear get referred to as once I pop TestPlatfromViewController
following apple’s documentation
https://developer.apple.com/documentation/uikit/uiviewcontroller/1621423-viewdidappear
Notifies the view controller that its view was added to a view hierarchy.
https://developer.apple.com/documentation/uikit/uiviewcontroller/1621477-viewdiddisappear
Notifies the view controller that its view was faraway from a view hierarchy.
so I get confused about add/take away view hierarchy
anybody will get some concept?
Why MyViewController’s viewWillAppear&viewDidAppear is NOT referred to as?