I have this delegate which intended to be execute when user scrolls with his fingers :
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
I have this line that scroll with code to the start :
[scroller scrollRectToVisible:CGRectMake(0, 0,scroller.frame.size.width,scroller.frame.size.height) animated:YES];
When i execute this line of code to scroll programmatically, the first delegate is also being called. I would like to eliminate this from happen.
I was trying to set the delegate to nil, but it still execute the delegate:
scroller.delegate=nil;//to not excute scrolldidscroll
[scroller scrollRectToVisible:CGRectMake(0, 0,scroller.frame.size.width,scroller.frame.size.height) animated:YES];
scroller.delegate=self;
EDIT:
I have read this great answer :Setting contentOffset programmatically triggers scrollViewDidScroll but it seems that his solution(the first) is without animation, while i need that animation .