user6092898
user6092898

Reputation:

How to combine sliding menu and uitabbarcontroller?

I am trying to integrate UITabBarController with Sliding menu. I'm using SWRevealViewController to create the sliding menu.

Following is the picture of my story board.

enter image description here

But the TabView is visible only for news. I want it to be like a new view just as android. In android we can combine both Navigation Drawer and TabPager. How can I do so in iOS?

Upvotes: 1

Views: 199

Answers (1)

Nishant Gupta
Nishant Gupta

Reputation: 457

Try as follows :

MainTabViewController *frontViewController = [[MainTabViewController alloc] init];
RearViewController *rearViewController = [[RearViewController alloc] init];

UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController];
UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:rearViewController];

SWRevealViewController *revealController = [[SWRevealViewController alloc] initWithRearViewController:rearNavigationController frontViewController:frontNavigationController];
revealController.delegate = self;

self.viewController = revealController;
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];           

Upvotes: 1

Related Questions