Coder Social home page Coder Social logo

mfsidemenu's People

Contributors

chien avatar chourobin avatar luugiathuy avatar mbinna avatar rayfix avatar shir avatar timzai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mfsidemenu's Issues

How to disable pan mode for specific view controllers?

Great library!

I'm new to iOS development and have one quick question - how can we disable the pan mode for specific view controllers (i.e. so that the behavior of swiping will not present the side menu controller)? The only 2 pan modes I could find were for the navigation bar and for the navigation controller -- can we disable those in some way?

Thanks again for your hard work.

Root UIViewcontroller freezes

Hi, I am using the MFSideMenu together with a UITabbarcontroller.

My code as follows:

//Setting up of tab bar controllers
NSMutableArray *controllers = [NSMutableArray new];
[controllers addObject:[self sideMenu:feedNavigationController].navigationController];
[controllers addObject:[self sideMenu:popularNavigationController].navigationController];
[controllers addObject:[self sideMenu:questionsNavigationViewController].navigationController];
[controllers addObject:[self sideMenu:notificationNavigationViewController].navigationController];
[controllers addObject:[self sideMenu:profileNavigationViewController].navigationController];

[self.tabController setViewControllers:controllers];

Code to initiate sideMenu:

- (MFSideMenu *)sideMenu: (DMNavigationController*) navigationController {
    DMSideMenuViewController *sideMenuController = [[DMSideMenuViewController alloc] init];

    MFSideMenuOptions options = MFSideMenuOptionShadowEnabled|MFSideMenuOptionMenuButtonEnabled|MFSideMenuOptionBackButtonEnabled;
    MFSideMenuPanMode panMode = MFSideMenuPanModeNavigationBar|MFSideMenuPanModeNavigationController;

    MFSideMenu *sideMenu = [MFSideMenu menuWithNavigationController:navigationController
                                             sideMenuController:sideMenuController
                                                       location:MFSideMenuLocationLeft
                                                        options:options
                                                        panMode:panMode];

    sideMenuController.sideMenu = sideMenu;

    return sideMenu;
}

In my sideMenuController, I have a didSelectRow event that adds a new controller on top of the current stack:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {

        DMUserProfileViewController *upvc = [[DMUserProfileViewController alloc]initWithNickname:[UserInfo sharedUserInfo].getNickname];

        [self.sideMenu.navigationController pushViewController:upvc animated:NO];
        [self.sideMenu setMenuState:MFSideMenuStateHidden];
    }
}

The issue is that when I click on the tab to 'pop' to root view (after loading a new viewcontroller), the rootviewcontroller freezes i.e. I am unable to interact with the page at all e.g. scroll or click on cell etc

Is there any reason to cause the rootviewcontroller to freeze up?

Thanks and regards

Zhen

Perform method on didSelectRow

I'm having issues calling a method from the mainView Controller in the sideMenu Controller (which is a UITableView) in didSelectRow.

Basically, I have a UIWebView in the mainView Controller which I want to scroll using

  • (void) scrollToPosition
    {
    [_webView stringByEvaluatingJavaScriptFromString:@"window.scrollBy(0,400);"];
    DLog(@"Called");
    }

and I can't figure out how can I call this method in the sideMenu Controller in the didSelectRow without instantiating a new mainView (if I instantiate a new one the method is called but of course, it does nothing).

Thank you !

panning can overshoot the underlying menu in certain cases

If you pan the main view all the way to the right, the main view will lock against the right edge of the underlying menu.

Now, pan the main menu back to the left about a quarter inch. Don't remove your finger from the screen. Try panning the menu all the way to the right. You should be able to overshoot the right edge of the underlying menu. The main view will snap back into position once you remove your finger from the screen.

The main menu should lock into position on the right for both cases.

MFSideMenu should definitely use view controller containment

Hi.

Thanks for a great lib!
There is one thing that would (in my opinion) make MFSideMenu a lot better! It's view controller containment. Imagine a scenario in which you would use MFSideMenu as the main window's RootViewController, having two properties for the menuViewController and contentViewController. It could potentially fix Issue #19, too.

Thank you for such a good library again:)

Adding two menu (Left & Right ) to navigation controller

Hi ,

i have already modify the code in "MFSideMenuManager " to view the Left Table from view Controller instad of TableView using storyboard

is there any way to add two Menu on the Left and Right with different View Controller from the same class , i'm trying to create new object from the "MFSideMenuManager " and changing the Methods property but i could not do it , i did not know where is the problem

if you can help please

How to make [MFSideMenuManager sharedManager]

I want to use MFSideMenu in my code.
When I wrote this line

if (controller != nil) {
NSArray *controllers = [NSArray arrayWithObject:controller];
[MFSideMenuManager sharedManager].navigationController.viewControllers = controllers;
}
[MFSideMenuManager sharedManager].navigationController.menuState = MFSideMenuStateHidden;

It said there is not declared.
What should I do ?

And when I wrote :
if (controller != nil) {
NSArray *controllers = [NSArray arrayWithObject:controller];
self.sideMenu.navigationController.viewControllers = controllers;
}
self.sideMenu.menuState = MFSideMenuStateHidden;
It didn't work and menu didn't close after touch table cell

Menu pan shows empty controller

Hi !
I have a problem. I've created an MFSideMenu with a nil right view controller but the gesture recognizer is still working and try to show the right menu. This right menu should not be shown if it's nil.

Can you test it the pan gesture recognizer ?

Thanks for everything.
Benoit

Disable Right Panning

Is there anyway to disable the right panning even when draggin the screen to the left?

Please add semantic version tags.

I’ve recently added MFSideMenu to the CocoaPods package manager repo.

CocoaPods is a tool for managing dependencies for OS X and iOS Xcode projects and provides a central repository for iOS/OS X libraries. This makes adding libraries to a project and updating them extremely easy and it will help users to resolve dependencies of the libraries they use.

However, MFSideMenu doesn't have any version tags. I’ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.

Semantic version tags (instead of plain commit hashes/revisions) allow for resolution of cross-dependencies.

In case you didn’t know this yet; you can tag the current HEAD as, for instance, version 1.0.0, like so:

$ git tag -a 1.0.0 -m "Tag release 1.0.0"
$ git push --tags

Tap status bar to scroll to top doesn't work

When i add a UITableViewController to my UINavigationController, when i do tap on the status bar doesn't scroll to top :(

My code in the MFAppDelegate.m... i used the demo project

DemoTableViewController *demoViewController = [[DemoTableViewController alloc] initWithNibName:@"DemoTableViewController" bundle:nil];

And 50 rows in 1 section to have scroll

Is there a solution to make it work?

Thanks for all :)

Crashes on iOS 4.3

I tracked down the crash to line 497 in MFSideMenu.m:

if (self.navigationController.isViewLoaded)
  self.navigationController.view.accessibilityViewIsModal = menuState == MFSideMenuStateClosed;

accessibilityViewIsModal is not available on iOS 4.3. I commented it out and the menu worked, so I think a respondsToSelector-check will do.

open left side all over

i have a seachbar into the tableheder of side left menu... now..my search bar is cutted in half because the main view is over the side.
How can i show the entire side menu only in certain events? Like facebook app does when you tap on search bar?

i am looking for a method for doing this...now i am using
[self.navigationController.sideMenu setMenuState:MFSideMenuStateVisible];
for partially showing the menu table.

thanks

Unregonized Selector running ios5

When running on ios5 i receive this error

 [UIView setTranslatesAutoresizingMaskIntoConstraints:]: unrecognized selector sent to instance 0x46dc40'

I believe it is because it is trying to set constraints where in ios5 it doesn't support this. I was thinking to check if it is ios5 and use AutoresizingMask instead else ios6 will continue to you constraints. Would this be the best way to go?

Side menu frame is wrong

Hi there,

When using a big table view inside a side menu controller, the frame of the menu controller is not fitting the app window frame.

How can we solve this ?
The bug occurs on both iOS 5/6.

Best regards,
Benoit

Can't scroll content in DemoViewController

Hi,

Can't manage to scroll content vertically in DemoViewController. I've been wrestling with it for a bit, and it seems that the gesture recognizer is overriding the default behavior of UIScrollView.

Any ideas on how to address this?

Autolayout problem with 5.1 release

Hi all, I use 5.1 and I have running problem. When I run ademo app I obtain this error:
'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'

If I disable Autolayout, app start but then crash whit other error:

2013-01-12 10:38:05.274 MFSideMenuDemo[875:c07] -[UITableView setTranslatesAutoresizingMaskIntoConstraints:]: unrecognized

Can you help me?

Thanks

Weird indentation of left side menu

I'm still trying to track down why there's this weird indentation on my left side menu. There's nothing special about it. It's a stock UITableView. See screenshot. Any tips would be appreciated.

Screen Shot 2013-03-02 at 3 35 20 PM

how to come back to a webview with a ulr?

I have added this library to my project and it works great but since, my main view is a UIWEbView I need to browse to an address when I click on the buttons inside the side menu but I do not know how to do it exactly. I am not an experienced programming in iOS I am still learning how this framework work.
Usually, from other views I set a public property in the web view and then call viewDidLoad but I don't know how to call the web view's controller from side menu.
could you help me in any way?.
thank you

Integration with UINavigationController

'm trying to integrate MFSideMenu in my project but I don't want to adopt the approach described in the GitHub depository as it defines the menu in the app delegate.

I have a login screen which will introduce with a segue (modal) a navigation controller with the main page as reported here: http://stackoverflow.com/questions/14084720/integrating-mfsidemenu-in-uinavigationcontroller

I would like to add the support for MFSideMenu in the navigationcontroller root controller using this code:

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        // Custom initialization
        self.sideMenuController = [[SideMenuViewController alloc] init];
        UINavigationController *navigationController = self.navigationController;

        MFSideMenuOptions options = MFSideMenuOptionMenuButtonEnabled|MFSideMenuOptionBackButtonEnabled
        |MFSideMenuOptionShadowEnabled;
        MFSideMenuPanMode panMode = MFSideMenuPanModeNavigationBar|MFSideMenuPanModeNavigationController;

        MFSideMenu *sideMenu = [MFSideMenu menuWithNavigationController:navigationController
                                                     sideMenuController:sideMenuController
                                                               location:MFSideMenuLocationLeft
                                                                options:options
                                                                panMode:panMode];

        sideMenuController.sideMenu = sideMenu;

    }
    return self;
}

When I run the app the menu button appears in my navigation bar but,if I press on it,nothing happens.

Any idea about how to fix it?

Thanks a lot

MFSideMenu only for ios6???

my project is running with deployment target of 5.0,
which does not have Layout Constraints like ios 6.

It allways crash on devices with ios prior to ios6 with the following message.
'Could not instantiate class named NSLayoutConstraint'
which should be called on line MFSideMenu:177

could it be possible that you rewrite this for older ios prior version 6?

Regards,
Jan

Retaining views

How would I retain views which have already been loaded. So in the didSelectRowAtIndexPath of the SideMenuViewController it wouldn't recreate a view if the user has already seen it?

So for instance, if a map is selected in the side menu, and you zoom into New York, when you come back to that view later, it's already zoomed in.

Modal Partial Curl with strange transparency effect

Present a modal with the Partial Curl effect and it will be rendered incorrectly, with transparency where there should be some shadow effects.

Can be fixed by completely disabling shadow on MFSideMenu or be setting rootViewController.view.layer.shadowOpacity to 0.0f before presenting the modal...

A very bad idea in the UINavigation category !!!!

This lib completely destroy the way navigation controllers work.

You are redefining UINavigationController appearance callbacks which is a really bad thing.
When you redefine a method in a category you completely replace this method with your own, it's not like inheritance where you have access to the super implementation.

To illustrate, consider the following code from UINavigationController+MFSideMenu.m:

- (void) viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    [self.sideMenu performSelector:@selector(navigationControllerWillAppear)];
}

Calling [super viewWillAppear:animated] here will call -[UIViewController viewWillAppear:] and not -[UINavigationController viewWillAppear:].
I think many issues, particularly in iOS 5, are due to this bad design.

An option would be to create a UINavigationController subclass or use delegation.

When adding a custom UITableView, the body pan mode does not work

I have created my navigation controller with a root view controller of UIViewController. Basically a simple setup. When I programmatically create a UITableView and add it to the viewController, the swipe does not work in the body but only the navigation bar. If I dont add the tableview, it works perfectly with no issues.

I have set the datasource and tableview delegate to self as well so everything is linked up.

Not sure why it will not work with the table view added. I am using version 0.3

Thanks a lot!

VoiceOver support

Side menu items get selected innappropriately when it is hidden. I have fixed this on my fork and will send a pull request shortly.

There is another issue that I didn't address which is that there is a strange text field in the xib of the demo app. You really notice it when you use the app with Voice Over.

iOS 6.0 required?

I've been playing around with the new version: 0.3

My app breaks In MFSideMenu.m - navigationControllerDidAppear on the line:
[menuView setTranslatesAutoresizingMaskIntoConstraints:NO];

It seems to be an iOS 6 only method.

Could you make the library iOS 5 (and higher) compatible?
Thanks

Screen not rotating in iOS5

Hi there,

I noticed that the orientation isn't rotating in iOS5. I was able to fix it by by adding this in UINavigationController+MFSideMenu.m. Though this is deprecated in iOS6, this still works and fixes the problem.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return (toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

Disable all gestures via option

It should be nice if the side menu can be disabled at a certain point by just calling a disable method on it. When it can be active again. We could call the enable method to activate it once again.

This could come in handy when you want to force your users through a wizard.

panning doesn't work correctly with one menu

If you implement MFSideMenu with only one side menu enabled, you'll find that panning doesn't work correctly. If you look at MFSideMenu.m, you'll find this code fragment:

  • (void) handleLeftPan:(UIPanGestureRecognizer *)recognizer {
    if(!self.rightSideMenuViewController) return;

If the rightSideMenuViewController is set to nil, the right side menu is locked out, which is the correct behavior.

However, if you've completely exposed the leftSideViewController, the if statement disables panning to the left, which makes the navigation controller appear to be locked into position on the far right.

The handleRightPan method has the same problem when leftSideViewController is set to nil.

You'll only see this problem under single menu implementations.

The fix is simple. If you want it, let me know.

Black screen when distributing ad hoc

Hi Mike, great project you've got here.

I'm having this issue where the side menu works just fine when debuging on my iPhone 4s but shows black when running it from an adhoc distribution (same device).

I really don't know where to start. Have you ever heard of anything like this?

This is how I instantiate the side menu:

CBYSideMenuViewController *sideMenuViewController =
(CBYSideMenuViewController *)[self.storyboard instantiateViewControllerWithIdentifier:SIDE_MENU_VIEW_CONTROLLER_ID];

self.sideMenu =
[MFSideMenu menuWithNavigationController:self.navigationController
                  leftSideMenuController:sideMenuViewController
                 rightSideMenuController:nil];

sideMenuViewController.sideMenu = self.sideMenu;

Screenshots
Debuggin from Xcode
Debugging from Xcode

Running adhoc
Running adhoc

Thanks in advance!

Remove lag

Hi,

Can you add in your method (MFSideMenuManager.m) :

+(void) configureWithNavigationController:(UINavigationController *)controller sideMenuController:(id)menuController {
[...]
//ADD THIS LINE
controller.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:controller.view.bounds].CGPath;
}

Thanks Vinicius Albino (comment on Cocoa Controls)

Displaying a modal view from the right menu changes the frame

This is a strange one. If you display a modal view while in the right menu and then dismiss it, the right menu view will be moved back to the left - i.e. its frame will change and it will have an origin of 0,0 instead of the origin that is offset by the kMFSideMenuSidebarWidth and its width will be the full screen.
Before showing the modal view:
iOS Simulator Screen shot Mar 19 2013 3 38 27 PM

After dismissing the modal view:
iOS Simulator Screen shot Mar 19 2013 3 38 33 PM

Bug with UITabBarController and multiple UINavigationController

If I use UITabBar and UINavigationController programmatically there is an issue with MFSideBarMenu.

The sideMenuController doesn't appear if there are more than one TabBarItem.

Code :

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    self.tabBarController = [[UITabBarController alloc] init];
    NSMutableArray *tabs = [[NSMutableArray alloc] init];

    HomeViewController *homeViewController = [[HomeViewController alloc] init];
    [homeViewController setTitle:@"First"];
    UINavigationController *homeNavigationController = [[UINavigationController alloc] initWithRootViewController:homeViewController];
    [tabs addObject:homeNavigationController];

    CatalogViewController *mySecondViewController = [[CatalogViewController alloc] init];
    [mySecondViewController setTitle:@"Second"];
    UINavigationController *secondNavigationController = [[UINavigationController alloc] initWithRootViewController:mySecondViewController];
    [tabs addObject:secondNavigationController];

    [self.tabBarController setViewControllers:tabs];

    [self.window setRootViewController:self.tabBarController];

    [self.window makeKeyAndVisible];

    SidebarViewController *sideMenuViewController = [[SidebarViewController alloc] init];

    MenuOptions options = MenuButtonEnabled|BackButtonEnabled;
    [MFSideMenuManager configureWithNavigationController:homeNavigationController
    sideMenuController:sideMenuViewController
    menuSide:MenuLeftHandSide
    options:options];
    return YES;
    }

Any solutions ?

Thanks

How can i enable pan mode for sideMenuButton again?

Hy there,
I used an older version on MFSideMenu, but now i upgraded it to the latest and my sideMenuButton no longer use the pan effect.
Actually i don't really used gestureRecognizers and i really need any time to spend my own code.
Can someone help to reenable this option? Like forcing

  • (void) toggleSideMenuPressed:(id)sender To use the
  • (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
    maybe? I don't really know. Thank you

Mailcomposer overwriting in the slidemenu

Hi

its great component to use it,currently facing issue when i add the Mailcomposer in the slidemenu,It was overwriting in the same slidemenu.May i know how to make the composer to come out of the slide menu,
Even i have tried on the top of the Demoviewcontroller facing same problem.
Can you please guide me to fix this issue.

Thanks in advance.
iOS Simulator Screen shot 10-Dec-2012 1.05.17 PM.png

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.