-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabling temporarily the slidemenu or selected menuitems #113
Comments
I read through issue 76 and followed that instructions. Now my SASlideMenu is disabled until the user creates a first profile, which is nice. However, if the user deletes his profile, the menu is NOT disabled again. Here is my code in SASlideMenuViewController: -(Boolean) disablePanGestureForIndexPath:(NSIndexPath *)indexPath{ -(void) configureMenuButton:(UIButton *)menuButton{ -(void) prepareForSwitchToContentViewController:(UINavigationController )content{
} In my MRHomeViewController (That is the main view controller) in viewWillAppear: if ([self shouldEnableSASlideMenu]) { And of course I have passed the menuButton to my MRHomeViewController... |
Hi Michael, If I understand correctly, you need something like what is described in #84. The idea is that you present the SASlideMenuViewController only when logged in with your profile and when you logout you are sent back to the login/signup views. |
No Stefano, Actually I would love to see a feature like this:
|
What I Understand is that you want the menu to be active only when the user selected a profile and when the profile is selected the menu is presented again.
The method will be called when the new profile is selected. The implementation will look like:
Than in the SASlideMenuViewController implementation there will be a menu item that will call
The selectProfile implementation and
|
Ok, tx. I will try that... |
I should clarify my app scenes a bit: There is a ViewController A, which is the scene presented when the user starts the app. When there are NO existing profiles, the menu button should be disabled. There is another view controller C, which is accessible through the slide menu, and which is a table view controller displaying all existing profiles. The user can edit an existing profile by clicking a table view cell which will open profile view controller B. He can click on a navigation bar button on the right "+" which will open the view controller B in modal mode to add a new profile. So, in this table view controller C, the user can delete profiles, too. So it can happen that the user deletes all profiles, and if this happens, the menu button should be disabled, to prevent the user from navigating away from that scene, until he creates a new profile by tapping "+" and opening a profile view controller C. This is not exactly the scenario you describe above. I manage to have the menu button enabled and disabled by storing a reference to it, either in the SASlideMenuViewController or the respective view controller, however, when the user would navigate A --> B --> A --> C... etc. but if he ever selects a different view controller in the slide menu, the reference somehow is lost.... I was coding something on the lines of issue 76 #76 but the refernce always is lost once the user slides the menu and selects any other scene, and goes back to C. Then the reference to the button in C is lost. I need a way to enable/disable the slidemenu, after any user action/navigation, in any view controller, based on some criteria... |
There is a menu button on each content view thus you have to disable/enable all of them and I think is the wrong way of doing it. |
I understand. I don`t see a way to disable/enable all of them from anywhere, because I don’t know how I can obtain references to each of them? Is there a way to obtain references to each of them anytime, anywhere. From what I gathered, I can only obtain a reference to the last used content, so when a user navigates to somewhere else, I don`t have a reference to the buttons on the other content view controller…? On 20 Feb 2014, at 11:15, stefanoa [email protected] wrote:
|
I am using your SASlideMenu with storyboards, as you know.
I have a button on my first view controller, which segues to a view controller, where the user can create his profile. I need to ensure that before a user moves to one of the view controllers in the slide menu, the user first creates a profile. I think that means to disable the SASlideMenu until the profile is created.
How can I do that?
Better than completely disabling the SASlideMenu would be to disable selectively menuitems and enable them again, once the user created his profile.
How can I do that?
The text was updated successfully, but these errors were encountered: