Skip to content

Instantly share code, notes, and snippets.

@edwardean
Forked from jordanekay/gist:8855193
Created September 3, 2016 14:19
Show Gist options
  • Save edwardean/2cb6f4315b6cf9bb82e24f641b7b1449 to your computer and use it in GitHub Desktop.
Save edwardean/2cb6f4315b6cf9bb82e24f641b7b1449 to your computer and use it in GitHub Desktop.
Debug -[UIScrollView setContentOffset:animated:] by changing duration
NSTimeInterval duration = 3.0;
SEL selector = @selector(_setContentOffsetAnimationDuration:);
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[scrollView methodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation setTarget:scrollView];
[invocation setArgument:&duration atIndex:2];
[invocation invoke];
[scrollView setContentOffset:contentOffset animated:YES]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment