I come with Android and I have a lot of headaches in iOS. I need to make the scroll menu like a movie. I used the following code:
rol = scroll_view.contentOffset.y; timer = [NSTimer scheduledTimerWithTimeInterval:.02 target:self selector:@selector(timer_rol) userInfo:nil repeats:YES]; -(void)timer_rol{ [scroll_view setContentOffset:CGPointMake(0,rol) animated:YES]; rol++; }
This code works fine, but when the user interacts with scrolling up or down, the view returns to position up to (value rol). The question is, how can I get the current position of the content after scrolling
I already tried these codes, but no one works:
CGPoint point = [scroll_view contentOffset]; rol = ry +1; -(void) handleGesture:(UIGestureRecognizer *) sender{} -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {} -(void)scrollViewDidScroll:(UIScrollView *)scrollView {}
Can anybody help me?
source share