gotosleep/JASidePanels — pull request #36 by rnystrom (2013-01-24 15:56:32+00:00)
Title: Enable or disable swipes from left and right

Added two new properties following project conventions.

```objc
@property (nonatomic, assign) BOOL allowLeftSwipe; // defaults to YES
@property (nonatomic, assign) BOOL allowRightSwipe; // defaults to YES
```

In -gestureRecognizerShouldBegin: I added a check for the state of each property and the direction of the gesture to determine if the gesture should begin.

```objc
// determine if right swipe is allowed
if (translate.x < 0 && ! self.allowRightSwipe) {
return NO;
}
// determine if left swipe is allowed
if (translate.x > 0 && ! self.allowLeftSwipe) {
return NO;
}
```

This is a pretty simple change that adds some functionality that I needed in my application. My usage was to have the right VC only be visible with selection of a button press, not a gesture. Other uses could be for disabling/enabling swipes during runtime.