Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
5020
SideMenuView Issues
posted

Hi,

I'm seeing issues with the SideMenuView (not slide tab).

If you create a SideMenuView without a rect via [IGSideMenuView new] the resulting contentView doesn't get sized correctly. Init without a rect is common for auto layout users. To test this, set the side view's backgroundColor to redColor and the side view's contentView.backgroundColor to orangeColor. Notice how with auto layout, when the view gets its layout, the contentView is not resized.

Additionally, I can't seem to get presentsWithGesture or minimumPressDuration working properly. The pan gesture fires instantly 99% of the time. Ideally, this view would use UIScreenEdgePanGestureRecognizer on either side. Can I disable the default gesture and add my own and then trigger -openSideMenu: manually?

  • 4940
    Offline posted

    Hi Caylan,

    Here's the answers to your questions.

    When using auto layout, why doesn't the contentView get sized correctly?

    During initialization of the control the contentView is added as a subview of IGSideMenuView and does attempt to take the same size, but fails to set a proper size because iOS has not yet finished calculating it. You can manually set the contentView frame in the viewDidLayoutSubviews method of your view controller.

    Can I disable the long press default gesture and add my own?

    Yes, if you disable presentsWithGesture, the default gesture is removed from the contentView. When a custom gesture is added to the contentView, you can call openSideMenu: to expose the menu or closeSideMenu to close it.

    Why doesn't the IGSideMenuView have a delegate call like the grid's cellLocationInViewPortChanged?

    It does! The IGSideMenuViewDelegate has the following methods.

    • – sideMenuView:contentViewLocationDidChange:
    • – sideMenuView:sideDidClose:
    • – sideMenuView:sideWillClose:
    • – sideMenuView:sideDidOpen:
    • – sideMenuView:sideWillOpen:

    As far as the issue with velocity, I'll need to do some research to see if I can reproduce what you've experienced. If it's reproducible I'll create a bug in our system and attach it to your case.

  • 5020
    posted

    Also, it'd be nice to have a delegate call similar to the grid's cellLocationInViewportChanged. That way, we could dim/blend/animate the SideMenu's contentView or similar. Now that I think of it, being able to get the same message for the leftView/rightView would be handy, too.

    Lastly, there's a small bug in the current pan gesture. If you drag the left menu open and then do a big swipe to the left (to close the left menu and open the right) you can sometimes get just enough velocity to half-open the other side's menu.

    I hope you can fix this soon because a side menu is crucial to completing my POC and I'm afraid I'll have to explore other controls to get this functionality.