I try to call a method after a delay when the user start to dragging a scrollView.
This block below is called but the action define in this performselector: is called only when I stop to drag the scrollView
- (void)viewDidLoad {
[super viewDidLoad];
UIScrollView *sv = [[UIScrollView alloc] initWithFrame:self.view.frame];
sv.delegate = self;
sv.backgroundColor = [UIColor redColor];
[sv setContentSize:CGSizeMake(1000, 200)];
[self.view addSubview:sv];
}
-(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
NSLog(@"hey");
[self performSelector:@selector(myAction) withObject:nil afterDelay:3];
}
- (void)myAction
{
NSLog(@"Called 3secondes after begin dragging");
}
I also try with a NSTimer and in the background thread but the problem is the same...
Any Idea?