iOS-Slide-Menu icon indicating copy to clipboard operation
iOS-Slide-Menu copied to clipboard

SlideNavigationControllerDidClose not fired when user keeps touches pressed and closes menu.

Open alexagat opened this issue 10 years ago • 3 comments

If a user opens the menu (by sliding), keeps his finger on the screen, and then closes the menu without lifting his finger up the entire time, the 'SlideNavigationControllerDidClose' notification never gets fired.

alexagat avatar Apr 28 '15 22:04 alexagat

Same issues for me

TayfunAslan avatar May 05 '15 08:05 TayfunAslan

For me too. My hacky solution:

In - (void)moveHorizontallyToLocation:(CGFloat)location:

if (self.view.frame.origin.x <= 1){
    Menu menu = (self.horizontalLocation > 0) ? MenuLeft : MenuRight;
    [self postNotificationWithName:SlideNavigationControllerDidClose forMenu:menu];
}

aerow69 avatar May 11 '15 13:05 aerow69

Here's the solution I am using in the mean time, which logically I think is doing the same thing as @aerow69 solution above which checks the self.view.frame.origin.x position.

  1. I subclassed SlideNavigationContorllerAnimator
class SlideNavigationContorllerAnimatorSlideCustom: NSObject, SlideNavigationContorllerAnimator {
}
  1. In the animateMenu function I check when progress == 0. I am not posting a notification, but instead running some other logic, which is why I have the // do stuff here line.
func animateMenu(menu: Menu, withProgress progress: CGFloat) {
  if (progress == 0) {
    // do stuff here
  }
}

alexagat avatar May 13 '15 02:05 alexagat