romaonthego / RESideMenu

iOS 7/8 style side menu with parallax effect.
MIT License
7.1k stars 1.35k forks source link

bouncesHorizontally always enable when first pan #235

Open GF-Huang opened 9 years ago

GF-Huang commented 9 years ago

in

- (void)panGestureRecognized:(UIPanGestureRecognizer *)recognizer {
    // ...
    if (recognizer.state == UIGestureRecognizerStateChanged) {
        // ...
        if (!self.bouncesHorizontally && self.visible) { // self.visible is "NO" when first pan(keep finger drap to right side) 
           if (self.contentViewContainer.frame.origin.x > self.contentViewContainer.frame.size.width / 2.0)
               point.x = MIN(0.0, point.x);

            if (self.contentViewContainer.frame.origin.x < -(self.contentViewContainer.frame.size.width / 2.0))
                point.x = MAX(0.0, point.x);
        }
    }
}