gresrun / GHSidebarNav

A clone of the new Facebook iOS UI paradigm
Apache License 2.0
607 stars 136 forks source link

How to use modal view controller? #9

Closed jiripsota closed 11 years ago

jiripsota commented 11 years ago

Hello, is there way how to correctly use modal view? For example when I want to present modal view in some content screen (selected by menu). View is presented correctly, but when is need to close modal view by dismissModalViewControllerAnimated it does not work. View is closed but content view is reset to first controller.

Thanks a lot for any advice. All best.

gresrun commented 11 years ago

I'm not sure I understand your question. Are you presenting a modal view as a result of an action in a content view and when you dismiss the modal view, the launching content view has been reset to the original?

roncito commented 11 years ago

presenting a modal view as a result of an action in a content view and when you dismiss the modal view, the launching content view has been reset to the original

I am observing this exact behavior.

rbauer commented 11 years ago

I also am experiencing this same problem. Any help would be appreciated.

rbauer commented 11 years ago

I have found that the viewWillAppear method on the GHMenuViewController was getting called (as it should) when the modal was being dismissed. Inside of this method, the [self selectRowAtIndexPath: ...] was being called and setting the selected menu item to the root item.

I removed this from the viewWillAppear method and added it to the viewDidLoad method instead. This seems to have resolved the problem for me. Hope it does for anyone else experiencing the same problem.

roncito commented 11 years ago

This works for me as well. Thanks!

gresrun commented 11 years ago

Let me know if this fix works for everyone.

gresrun commented 11 years ago

Closing since this looks fixed and no one cared to complain again.