Harish
Harish

Reputation: 2512

iOS Swipe Gesture - Time delay for swipe

I have an UIWebview where i'm loading multiple URL's using SwipeGesture i'm swiping to next page. I have used this code to do this,

UISwipeGestureRecognizer* swipeUpGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeUpFrom:)];
swipeUpGestureRecognizer.direction = UISwipeGestureRecognizerDirectionUp;

in handleSwipeUpFrom method i'm loading next URL in my webview. Everything works PERFECTLY. But the swipe is works so fastly. I want to make some delay to it, any ideas....

Upvotes: 0

Views: 764

Answers (1)

joeByDesign
joeByDesign

Reputation: 133

It may be a bit messier, but if no one has a cleaner solution, try this:

- (void)handleSwipeUpFrom:(id)sender
{
    [self performSelector:@selector(anotherMethod:) withObject:object afterDelay:1.0];
}

Upvotes: 1

Related Questions