"Your users be pressin' long, but do they know how long they need to be pressin'?"
ZCSHoldProgress is a UILongPressGestureRecognizer subclass with some nice (customizable) visual flair.
pod 'ZCSHoldProgress', '~> 0.0.5'
#import "ZCSHoldProgress.h"
ZCSHoldProgress *holdProgress = [[ZCSHoldProgress alloc] initWithTarget:self action:@selector(gestureRecogizerTarget:)];
holdProgress.minimumPressDuration = 3.0;
[self.view addGestureRecognizer:holdProgress];
- (void)gestureRecogizerTarget:(UIGestureRecognizer *)gestureRecognizer {
if (gestureRecognizer.state == UIGestureRecognizerStateBegan) {
// TODO: do something interesting
} else if (gestureRecognizer.state == UIGestureRecognizerStatePossible) {
// TODO: knock it off with the interesting stuff
}
}
Send me Pull Requests here, please.