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