From 3dbdd6dff65931d81d7cd29ca4e5aad4ebed10d0 Mon Sep 17 00:00:00 2001 From: coridn Date: Thu, 18 Sep 2014 09:37:29 -0400 Subject: [PATCH] Fix Issue #332 This fixes the unwind segues for applications running iOS 8. --- SWRevealViewController/SWRevealViewController.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/SWRevealViewController/SWRevealViewController.m b/SWRevealViewController/SWRevealViewController.m index 81c7df6..78453d0 100755 --- a/SWRevealViewController/SWRevealViewController.m +++ b/SWRevealViewController/SWRevealViewController.m @@ -670,6 +670,20 @@ - (UIViewController *)childViewControllerForStatusBarHidden return controller; } +#pragma mark - UIStoryboardUnwindSegue Support + +-(UIViewController *)viewControllerForUnwindSegueAction:(SEL)action fromViewController:(UIViewController *)fromViewController withSender:(id)sender +{ + //Still allow the default logic, and only override it if it does not provide a view controller. + UIViewController *viewController = [super viewControllerForUnwindSegueAction:action fromViewController:fromViewController withSender:sender]; + + if(!viewController) + { + viewController = [self.frontViewController viewControllerForUnwindSegueAction:action fromViewController:fromViewController withSender:sender]; + } + + return viewController; +} #pragma mark - View lifecycle