Skip to content

Commit

Permalink
improved code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans Seiffert committed Jul 17, 2015
1 parent 5680981 commit aa8248a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ typedef NS_ENUM(NSInteger, GBScrollDirection) {
@property (nonatomic, getter = isTapEnabled) BOOL tapEnabled;

/**
* Whether to use GBInfiniteScrollViews UIPanGestureRecognizer or not. A usage results in a simultaneously gesture recognizer usage!
* The default is YES.
* Whether to use GBInfiniteScrollViews UIPanGestureRecognizer or not.
* If enabled, the simultaneously gesture recognizer usage will be enabled.
* This can result in unwanted scroll delegation behavior if you use the GBInfiniteScrollView above other UIScrollViews as the touch input is delegated to these UIScrollViews too.
* Default value YES.
*/
@property (nonatomic) BOOL useInfiniteScrollPanGestureRecognizer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,14 @@ - (void)setTapEnabled:(BOOL)tapEnabled {
[self setupTapGesture];
}

- (void)setUseInfiniteScrollPanGestureRecognizer:(BOOL)useInfiniteScrollPanGestureRecognizer {
- (void)setUseInfiniteScrollPanGestureRecognizer:(BOOL)useInfiniteScrollPanGestureRecognizer
{
_useInfiniteScrollPanGestureRecognizer = useInfiniteScrollPanGestureRecognizer;

if (self.useInfiniteScrollPanGestureRecognizer) {
if (self.infiniteScrollViewPanGestureRecognizer == nil) [self setupPanGesture];
if (self.infiniteScrollViewPanGestureRecognizer == nil) {
[self setupPanGesture];
}
} else {
[self removeGestureRecognizer:self.infiniteScrollViewPanGestureRecognizer];
self.infiniteScrollViewPanGestureRecognizer = nil;
Expand Down Expand Up @@ -1805,7 +1808,7 @@ - (void)scrollToPageAtIndex:(NSUInteger)index animated:(BOOL)animated

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
//If the usage of the PanGestureRecognizer is enabled, we need to enable simultaneously gesture recongizing. If not, it's not needed.
//If the usage of the UIPanGestureRecognizer is enabled, we need to enable simultaneously gesture recognizing. If not, it's not needed.
return self.useInfiniteScrollPanGestureRecognizer;
}

Expand Down

0 comments on commit aa8248a

Please sign in to comment.