aryaxt / iOS-Slide-Menu

iOS Slide Menu with ability to add both left and right menu, and built in gesture recognizer. Similar to Path and Facebook
Other
1.53k stars 359 forks source link

Tab Bar Black Screen on every vc but one #184

Open cculos opened 9 years ago

cculos commented 9 years ago

I'm having an issue with implementing the Slide Menu within a Tab Bar controller. Each tab bar item has a SlideNavigationController in it but it's only listening to one view out of 3 that are currently trying to implement it.

I get the notifications for the open / close right menu on each view, the menu is there and the slide animation works but its ignoring everything else; initialization, the side offset, etc is all ignored.

I have the following setup in each instance of ViewDidLoad:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"primaryNavStoryboard" bundle:nil];
pbDrawerMainViewController *drawerView = (pbDrawerMainViewController*)[storyboard instantiateViewControllerWithIdentifier:@"drawerView"];
[SlideNavigationController sharedInstance].rightMenu = drawerView;
[SlideNavigationController sharedInstance].portraitSlideOffset = [self pixelsFromIndex:1];
[drawerView.tableView setUserInteractionEnabled:YES];

The app delegate is only handling the notifications. The above code works only in a single view controller. The rest are presenting the menu and sliding but the view is ignoring the offset and the sub view itself is black, even though the code and storyboard itself is identical for each view.

How do I handle this?

SCLDev commented 8 years ago

I had the same issue, what I did was to use the delegate methods (opposed to the block), and it worked. Also, you need to connect the view controllers to the navigation controller in storyboard (navigation controller being the slidernavigationcontroller). Then using the popAll...method (the readme file and the amazing tutorial by the author has that), navigate to the view controller you need (create the storyboard, instantiate the view controller and the rest). I hope this helped.

babumoshai-ankush commented 6 years ago

Any luck? I am also in the same loop. Kindly help.