Skip to content

Commit

Permalink
draggableBorderAllowing
Browse files Browse the repository at this point in the history
  • Loading branch information
Joan Lluch committed Apr 28, 2014
1 parent be2bdb2 commit 69087d5
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions SWRevealViewController/SWRevealViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1102,14 +1102,11 @@ - (BOOL)_panGestureShouldBegin
UIView *recognizerView = _panGestureRecognizer.view;
CGFloat xLocation = [_panGestureRecognizer locationInView:recognizerView].x;
CGFloat width = recognizerView.bounds.size.width;

BOOL draggableBorderAllowing = ( _frontViewPosition != FrontViewPositionLeft || _draggableBorderWidth == 0.0f );
if (_rearViewController) {
draggableBorderAllowing = draggableBorderAllowing || xLocation <= _draggableBorderWidth;
}
if (_rightViewController) {
draggableBorderAllowing = draggableBorderAllowing || xLocation >= (width - _draggableBorderWidth);
}

BOOL draggableBorderAllowing = (
_frontViewPosition != FrontViewPositionLeft || _draggableBorderWidth == 0.0f ||
(_rearViewController && xLocation <= _draggableBorderWidth) ||
(_rightViewController && xLocation >= (width - _draggableBorderWidth)) );

// allow gesture only within the bounds defined by the draggableBorderWidth property
return draggableBorderAllowing ;
Expand Down

0 comments on commit 69087d5

Please sign in to comment.