alexiscreuzot / KASlideShow

Ultra-basic slideshow for iOS (ARC only).
MIT License
206 stars 61 forks source link

Ability to perform action upon tapping on slide index #59

Closed docash59 closed 6 years ago

docash59 commented 6 years ago

I know the library already has the Tap and Slide gesture but that is to advance the slideshow to next one. However, Im talking about performing an action like tapping on current index and opens a URL or something. Adding this would be great!

alexiscreuzot commented 6 years ago

This is already possible with something like this :

UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self 
action:@selector(__your_method__)];
tap.delegate = self;
[self.slideshow addGestureRecognizer:tap];

Just don't forget to implement the delegate likeso :

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
    return true;
}