Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWRevealViewController on iOS 9 not working #443

Open
erhkeoprhjospdg opened this issue Jul 7, 2015 · 18 comments
Open

SWRevealViewController on iOS 9 not working #443

erhkeoprhjospdg opened this issue Jul 7, 2015 · 18 comments

Comments

@erhkeoprhjospdg
Copy link

Hi,

I just tried to use this library in iOS 9:

  1. Create project template Master-Detail Application.
  2. In new Xcode should be also UISplitView Controller as initial controller.
  3. I added RevealView Controller with UITableView Controller to the storyboard

When I drag master view it works good. When I push right button to reveal rear view it does not work.
In iPad application it doesn't work at all.

How can I fix this issues? Can you please help me?

Thanks,
Ruslan

@sfbayman
Copy link

I have also tried to integrate this and no luck.
Getting stuck in the loadStoryboardControllers method block.
//Try each segue separately so it doesn't break prematurely if either Rear or Right views are not used.
@Try
{
[self performSegueWithIdentifier:SWSegueRearIdentifier sender:nil]; // stuck here
}
@catch(NSException *exception) {}

Softwares: iOS 9 and Xcode 7 beta 3

Need help.

@Stun-nutS
Copy link

Hi,

Same issue for for me.
On view controllers, self.revealViewController return "nil". So I can't call the menu with any button or gesture.

Thanks,
Stun

@BaranBerk
Copy link

I have updated iPhone 5 to iOS 9 and then over test flight send the app ( as internal tester). It works fine

@rycardo
Copy link

rycardo commented Aug 6, 2015

BaranBerk, Have you compiled the project in Xcode 7 for iOS 9? Or only updated your device to iOS 9 and tried? Using my app compiled in Xcode 6.x for iOS 8.x, on an iOS 9 device, yes, everything works as intended. However, If I compile the project in Xcode 7 beta 4 for iOS 9 beta 4, then my rear view controller will not display on that same device running iOS 9.

@BaranBerk
Copy link

I havent't updated xcode it is still 6.x. I have just updated my device to iOS 9 and tried.

@Stun-nutS
Copy link

In fact, in iOS 9 the property "parent" of navigation controllers created by the SW segue is nil, so in
@implementation UIViewController(SWRevealViewController), no SWRevealViewController are found and nothing else can't work.
I'm looking for a workaround to retrieve the instantiated SWRevealViewController.
If it's an ARC upgrade the controller is probably deleted...

@rycardo
Copy link

rycardo commented Aug 19, 2015

I was able to get it to work, but I'm not sure why. I deleted all the connections between my existing classes and view controllers; created new view controllers in the Storyboard; created new source files for the classes; copied all the code from my original class files (.h and .m); connected the new storyboard outlets to the new files. Now SWRevealViewController works in iOS 9 using Xcode 7. It was quite a bit of tedious effort to do, but it worked for me. YMMV Rycardo

@ghost
Copy link

ghost commented Sep 2, 2015

Anybody have any idea how to make this work on xCode 6 and iOS9?

@joshjack
Copy link

joshjack commented Sep 9, 2015

Any updates? iOS 9 is officially launching next week and iOS users tend to update pretty quickly

@joshjack
Copy link

I have just updated to XCode 7 today, but I'm still using iOS 8.4 on my devices. This issue popped up immediately. The first view to load works fine with SWReveal, but when I segue to my next view the self.revealviewcontroller call returns nil everytime.

I even tried passing a global reference to the revealviewcontroller and none of the calls to "rightrevealToggle" work anymore (same for left). No exceptions or errors, just nothing.

@sebastienALU
Copy link

I had a similar issue.
To solve it, I have deleted from my UITableView the UITableViewCell triggering the segue from the SWReveal in my storyboard.
Next I have created again the UITableViewCell and the Segue in my storyboard and t's working again.

@joshjack
Copy link

My front controller was a navigation based controller. I seem to have fixed the issue in Xcode 7 by changing the segues from normal push to SWRevealControllerSeguePUSH. In some cases (not sure why the difference) I also have to use a global reference to the SWRevealController as the parent can be nil.

@pontus-andersson
Copy link

I managed to do a work around on Xcode 7 by initiating the SWRevealViewController by code using:
- (id)initWithRearViewController:(UIViewController *)rearViewController frontViewController:(UIViewController *)frontViewController
instead of storyboard segues.

@Stun-nutS
Copy link

@pontus-andersson : could you paste a sample of your workaround please?

@pontus-andersson
Copy link

@Stun-nutS : I do this in the AppDelegate after my synchronization handler is completed. Hope it helps.

IPMenuTableViewController *menuTableViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"IPMenuTableViewController"]); UINavigationController *messagesNavigationController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"IPMessagesNavigationController"]; SWRevealViewController *rootViewController = [[SWRevealViewController alloc] initWithRearViewController:menuTableViewController frontViewController:messagesNavigationController]; self.window.rootViewController = rootViewController;

@ksuh999
Copy link

ksuh999 commented Sep 23, 2015

So I faced the same problem - menu would not appear when the menu button was tapped or from swiping.

Turns out it was because I used the performSegueWithIdentifier method in the controller displayed from the "sw_front" segue (it was a login view, but if the person was already logged in, I took them to another view that was more useful).

Calling performSegueWithIdentifier meant that the reference to the SWRevealController instance was lost in the next view - hence self.revealViewController() was always nil.

So basically you can never use performSegueWithIdentifier if you want the menu to work. If you want to show a view progammatically, do this:

let view = self.storyboard!.instantiateViewControllerWithIdentifier("<the Storyboard ID of the navigation controller>") as! UINavigationController

self.revealViewController().pushFrontViewController(view, animated: <true or false>)

Note that you have to push the navigation controller for the view you want to display, otherwise you won't see the navigation on the destination view.

This will give you the proper reference to the SWRevealController on the destination view.

@joshjack
Copy link

joshjack commented Oct 5, 2015

Actually, I'm still having pretty good luck using performSegueWithIdentifier as long as the segue class is set to SWRevealViewControllerSeguePushController in the Storyboard.

@rauluranga
Copy link

@ksuh999 i'm having the same problem and discovered that if i delete the
performSegueWithIdentifier method, the self.revealViewController() works again does not return nil anymore.
so, is still the solution to manually call self.revealViewController().pushFrontViewController??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants