How to make a TabBar button loading always the first view of a NavigationController
-
09-10-2019 - |
سؤال
How can I force a TabBar button to load always the first view of a NavigationController?
I don't want to load the last in time loaded view but always come back to the first view of that NavigationController scheme.
Thank You very much!
المحلول
Select the top view when you tap a TabBarItem
like so:
[someNaviagtionController popViewControllerAnimated:YES];
Depending on how you set your UITabBar
up, call it either from tabBarController:shouldSelectViewController:
or from tabBar:didSelectItem
.
نصائح أخرى
You can call popToRootViewControllerAnimated:
.
Take a look here for more info.
لا تنتمي إلى StackOverflow