Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Preserve previous state #8

Open
Mazyod opened this issue Jul 3, 2014 · 2 comments
Open

Preserve previous state #8

Mazyod opened this issue Jul 3, 2014 · 2 comments

Comments

@Mazyod
Copy link
Contributor

Mazyod commented Jul 3, 2014

This issue was discussed a bit here #2, but I wanted to dedicate that issue for the navbar animation.

Currently, the TLYNavBarManager applies a "cleanup" in viewWillAppear, viewWillDisappear, causing the navbar state to be lost. We can't just remove that code, but I suppose we can change the prepareForDisplay to:

(self.previousContractionState ? [self contract] : [self expand]);

and of course, remove the code that resets the previousContractionState variable.

I will probably also add a public variable that users can use to switch this behavior on and off. As far as I can tell, the facebook app, for example, doesn't preserve the states when switching tabs or pushing view controllers.

@mitchtreece
Copy link

Great little library 👍

Trying to get state preservation working. I added the check into the prepareForDisplay method, but still am not able to get this working. Could you point me in the right direction?

@Mazyod
Copy link
Contributor Author

Mazyod commented Jan 4, 2016

@mitchtreece Thanks, appreciate you looking into this.

There is a lot of thought to be put into this, since of course, the navigation bar is still the same bar when you push a new controller. Meaning, you must somehow keep the navigation bar hidden on the current controller, while allowing the pushed controller to show its navigation bar. The same should happen when coming back.

This would be tricky, and as explained in #2, the only way could be by manipulating the visibility of the navigation bar through the navigation controller.

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

No branches or pull requests

2 participants