Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions MMDrawerController/MMDrawerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,30 @@ -(BOOL)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers{
return NO;
}

- (UIViewController *)viewControllerForUnwindSegueAction:(SEL)action fromViewController:(UIViewController *)fromViewController withSender:(id)sender
{
NSMutableArray *childViewControllersByPriority = [NSMutableArray arrayWithObject:self.centerViewController];

if (self.leftDrawerViewController) {
[childViewControllersByPriority addObject:self.leftDrawerViewController];
}
if (self.rightDrawerViewController) {
[childViewControllersByPriority addObject:self.rightDrawerViewController];
}

for (UIViewController *childViewController in childViewControllersByPriority) {
UIViewController *unwindViewController = [childViewController viewControllerForUnwindSegueAction:action
fromViewController:fromViewController
withSender:sender];

if (unwindViewController) {
return unwindViewController;
}
}

return [super viewControllerForUnwindSegueAction:action fromViewController:fromViewController withSender:sender];
}

#pragma mark - View Lifecycle

- (void)viewDidLoad {
Expand Down