New to iOS, kindly bare if the question is very basic? When I press the tab button multiple times, it is not invoking viewWillAppear function? If I am wrong, then which function gets invoked, each time a tab button is pressed being on the same tabview?
New to iOS, kindly bare if the question is very basic? When I press
Share
You are correct,
viewWillAppearis a little special, it is usually called automatically but in some cases including when you are adding a view controllers view manually (viewaddSubview:), and also when adding this as a view controller to aUITabViewControllerit doesn’t get messaged.This however is only for the root view, as you navigate (maybe with a navigation controller) back and forth, that root view’s
viewWillAppearwill get triggered as some point.In short, if you need to implement something in
viewWillAppearin these cases, you should message it yourself when you know it’s going to be presented. You can handle this case in your view controller, check out the following article about the matter:http://www.touchthatfruit.com/viewwillappear-and-viewdidappear-not-being-ca
Good luck.