From 3cc0a6b733bd352c4b3eca7181813b7a640cfc7d Mon Sep 17 00:00:00 2001 From: Miguel Date: Fri, 20 Sep 2013 13:44:16 +0200 Subject: [PATCH] Handling multiple UIGestureRecognizer --- StyledPageControlDemo/PageControlDemo/StyledPageControl.h | 2 +- StyledPageControlDemo/PageControlDemo/StyledPageControl.m | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/StyledPageControlDemo/PageControlDemo/StyledPageControl.h b/StyledPageControlDemo/PageControlDemo/StyledPageControl.h index 084ee9c..8e59cdb 100644 --- a/StyledPageControlDemo/PageControlDemo/StyledPageControl.h +++ b/StyledPageControlDemo/PageControlDemo/StyledPageControl.h @@ -46,7 +46,7 @@ typedef enum PageControlStyleStrokedSquare = 6, } PageControlStyle; -@interface StyledPageControl : UIControl +@interface StyledPageControl : UIControl @property (nonatomic) UIColor *coreNormalColor, *coreSelectedColor; @property (nonatomic) UIColor *strokeNormalColor, *strokeSelectedColor; @property (nonatomic, assign) int currentPage, numberOfPages; diff --git a/StyledPageControlDemo/PageControlDemo/StyledPageControl.m b/StyledPageControlDemo/PageControlDemo/StyledPageControl.m index f83af7c..58a524d 100644 --- a/StyledPageControlDemo/PageControlDemo/StyledPageControl.m +++ b/StyledPageControlDemo/PageControlDemo/StyledPageControl.m @@ -67,6 +67,7 @@ -(void)setup{ _pageControlStyle = PageControlStyleDefault; UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTapped:)]; + tapGestureRecognizer.delegate = self; [self addGestureRecognizer:tapGestureRecognizer]; } @@ -394,4 +395,11 @@ - (UIImage *)selectedThumbImageForIndex:(NSInteger)index { return aSelectedThumbImage; } +#pragma mark - UIGestureRecognizerDelegate + +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer +{ + return YES; +} + @end