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

Fix issue where navigationItem would not be displayed under iOS 7 #210

Open timbodeit opened 8 years ago

timbodeit commented 8 years ago

For reasons, that I currenlty do not understand, the self.enableShadow and self.enableSwipeGesture calls in SlideNavigationController#setup cause problems under iOS 7 in my setup. I am instanciating a SlideNavigationController through a storyboard. While iOS 8 and 9 work fine, under iOS 7 I was seeing an empty navigation bar. It did have a navigationItem, though that didn't match the topViewController and didn't have any title or buttonItems.

I assume this issue arises from enableShadow and enableSwipeGesture both accessing the view property, while being called before viewDidLoad.

Deferring both of these calls and making them during them during viewDidLoad instead of during init, resolves the issue that I have been seeing under iOS 7.

aryaxt commented 8 years ago

Thanks for the PR: Couple of questions

1- Are you able to reproduce this in the demo app? 2- Are you setting your barbuttons in storyboard or in code? if in code are you doing after viewDidLoad? 3- Do you have a sample with this issue?

self.enableShadow and self.enableSwipeGesture call setup because as you try to access them the singleton object gets instantiated.

Thanks