Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gesture recogniser issue #32 #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion NMRangeSlider-Demo/NMDemoTVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#import "NMDemoTVC.h"

@interface NMDemoTVC ()

- (void)configurePanGesture;
- (void)panGestureTriggered:(UIGestureRecognizer *)gesture;
@end

@implementation NMDemoTVC
Expand All @@ -24,6 +25,9 @@ @implementation NMDemoTVC
- (void)viewDidLoad
{
[super viewDidLoad];

[self configurePanGesture];

[self configureStandardSlider];
[self configureMetalSlider];
[self configureSingleThumbSlider];
Expand Down Expand Up @@ -61,6 +65,12 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (void)configurePanGesture {
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureTriggered:)];

[self.view addGestureRecognizer:panGesture];
}

// ------------------------------------------------------------------------------------------------------

#pragma mark -
Expand All @@ -73,6 +83,9 @@ - (void) configureStandardSlider
self.standardSlider.upperValue = 0.53;
}

- (void)panGestureTriggered:(UIGestureRecognizer *)gesture {
NSLog(@"PanGestireTriggered");
}

// ------------------------------------------------------------------------------------------------------

Expand Down
5 changes: 5 additions & 0 deletions NMRangeSlider/NMRangeSlider.m
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,9 @@ -(void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event
[self sendActionsForControlEvents:UIControlEventValueChanged];
}

// Prevent any gesture recognizer to start traking touch events and cancel the touch in NMRangeSlider.
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
return NO;
}

@end