From 4e9ba2924821b90ff374ed8c99de931841048881 Mon Sep 17 00:00:00 2001 From: AndriyGo Date: Mon, 2 Jun 2014 17:04:09 +0200 Subject: [PATCH] Update MMDrawerController.m Introduced changes in the decodeRestorableStateWithCoder method so that during state restoration left/center/right controllers are not reassigned if they are already assigned by user --- MMDrawerController/MMDrawerController.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MMDrawerController/MMDrawerController.m b/MMDrawerController/MMDrawerController.m index 5b5a393d..6eeb3fc7 100644 --- a/MMDrawerController/MMDrawerController.m +++ b/MMDrawerController/MMDrawerController.m @@ -217,15 +217,15 @@ - (void)decodeRestorableStateWithCoder:(NSCoder *)coder{ [super decodeRestorableStateWithCoder:coder]; - if ((controller = [coder decodeObjectForKey:MMDrawerLeftDrawerKey])){ - self.leftDrawerViewController = [coder decodeObjectForKey:MMDrawerLeftDrawerKey]; + if ((!self.leftDrawerViewController)&&(controller = [coder decodeObjectForKey:MMDrawerLeftDrawerKey])){ + self.leftDrawerViewController = controller; } - - if ((controller = [coder decodeObjectForKey:MMDrawerRightDrawerKey])){ + + if ((!self.rightDrawerViewController)&&(controller = [coder decodeObjectForKey:MMDrawerRightDrawerKey])){ self.rightDrawerViewController = controller; } - if ((controller = [coder decodeObjectForKey:MMDrawerCenterKey])){ + if ((!self.centerViewController)&&(controller = [coder decodeObjectForKey:MMDrawerCenterKey])){ self.centerViewController = controller; }