0

I'm building a new project using ECSlidingViewController v2. The first time I swipe to open the left under view, it works great. But when I swipe the second time, I get an EXC_BAD_ACCESS crash. The reference is to the NSMapTable in the controller.

- (void)updateTopViewGestures {
    BOOL topViewIsAnchored = self.currentTopViewPosition == ECSlidingViewControllerTopViewPositionAnchoredLeft ||
                         self.currentTopViewPosition == ECSlidingViewControllerTopViewPositionAnchoredRight;
    UIView *topView = self.topViewController.view;

    if (topViewIsAnchored) {
       ...
    } else {
        ...
--->    [self.customAnchoredGesturesViewMap removeAllObjects];
    }
}

1 Answers1

0

Taking reference from @uiroshan answer Closing ECSlidingViewController menu

You can use the following code:

- (IBAction)showSlidingMenu:(id)sender 
{
   [self.slidingViewController anchorTopViewToRightAnimated:YES];
   if ([self.slidingViewController currentTopViewPosition] == ECSlidingViewControllerTopViewPositionAnchoredRight) 
   {
      [self.slidingViewController resetTopViewAnimated:YES];
   }
}

Here,

  • I am animating the top view controller to Right, so I am checking whether top view position is ECSlidingViewControllerTopViewPositionAnchoredRight
  • To animating the top view controller to Left ECSlidingViewControllerTopViewPositionAnchoredLeft
Community
  • 1
  • 1
iYoung
  • 3,596
  • 3
  • 32
  • 59