0

As stated in the title, I'm using MMDrawerController. To keep things simple, I have 3 ViewControllers, A, B, and C.

A is the initial ViewController, and it contains a side ViewController, which is C.

From A, I can segue to B. B also contains a side ViewController, which is C.

I decided it isn't worth the hassle for both A and B to have separate instances of C as their individual side ViewControllers, so I decided to use the same instance of C as both of their side ViewControllers.

When I start up the app, everything is great. I segue to B, and I see the same instance of C as the side ViewController. The problem is that when I dismiss B via self.dismissViewControllerAnimated(true, completion: nil) to get back to A, I no longer see C as the side ViewController. The side ViewController is completely black.

Even though I dismissed B, I know I didn't release C from memory. I still have an instance to it, I can still call stuff in it, and the MMDrawerController that encapsulates A still thinks that C is its side ViewController.

Why is this happening? How can I handle this?

Do I need State Restoration for this?

David
  • 7,028
  • 10
  • 48
  • 95

1 Answers1

0

I did It several times but in another way... I use C as menu and 'D' as a UINavigatorController with A as rootviewController for the center screen. So You can push/pop from A to B without change C.

Hope It helps

Bisca
  • 6,380
  • 2
  • 19
  • 32
  • I could see how this would work, but I don't want to use UINavigatorController – David Sep 01 '15 at 07:50
  • Ok, you can do the same withou UINavigationController, you can add another UIViewController to manage the 'center' screen and present one or other controller embeded inside the center controller. – Bisca Sep 01 '15 at 13:50