I will try to guide you from an architectural point of view (so you will not find much code below).
Using UITabBarController
In order to achieve what you offer, you are right , you cannot use the UITabBarController once , for several reasons, the most direct of them is that they should always be at the bottom , and you want it to be at the top (check out Apple docs ). The good news is that maybe you don't need it!
Note. If you still want to use the UITabBarController for any reason, see @Matt answer .
Using UINavigationController
You can use the UINavigationController to solve this problem, since the UINavigationBar for the UINavigationController can be customized. There are several ways to organize the hierarchy of views to achieve what you offer, but let me clarify one option:
To configure the UINavigationBar buttons to add, you just need to set its navigationItem header :
To add the functionality of the hamburger menu to the UINavigationController , you can find a few posts on how to do this, and endless frames that you can use. Check out this other SO question for a more detailed answer (e.g. MMDrawerController , ECSlidingViewController to mention a couple).
On organizing the hierarchy of views, it really depends on when the user deletes one of the main upper buttons, she will always refer to the first view controller in a new section or if you want to return it back to the last view in the section where it was.
3.1 In the switching sections, the first view of the new section is displayed
Your UIWindow application will have one UINavigationController on top of the hierarchy. Then, each of the top three buttons, when pressed, will change the root view controller of the UINavigationController .
Then, when the user changes the section, the current navigation hierarchy is discarded , setting the view controller of the new section as the root view controller of the UINavigationController .
self.navigationController = [sectionFirstViewController]
3.2. The switching sections display the last displayed view in a new section
This will require a slightly modified version above, where each of your sections will have its own UINavigationController , so you can always keep the navigation hierarchy in each section.
Then, when the user deletes one of the top buttons to switch the section, instead of changing as described above, you change the UIWindow root view controller to a new UINavigationController section.
window.rootViewController = sectionNavigationController
Using custom implementation
Of course, the latter, as well as the very correct option, is that you implement your own component to achieve your requirements. This is probably an option that requires a lot of effort in exchange for the highest customizability.
Choosing this option is definitely not recommended for less experienced developers.
source share