When/why/how would you use these methods?
- navigationController:willShowViewController:animated:
– navigationController:didShowViewController:animated:
Can’t you just use these UIViewController Instance Methods instead?
– viewWillAppear:
– viewDidAppear:
– viewWillDisappear:
– viewDidDisappear:
You’d use the first ones if you want to be informed about these events outside the visible view controllers. The delegates allow you to get a notification at a single point. Using
UIViewController‘s methods bind you within these controllers, where you’d have to write/call same code multiple times to achieve the same.Generally you’d divide tasks into these two groups: