Pretty much I need to detect when the scrollView is at 320 x to execute some code but the contentOffset seems to always be 0. When i set position==0 the code executes but i need it to execute at 320. Any ideas?
(void)scrollViewDidEndDecelerating:(UIView *)sender
{
int position = (_scrollView.contentOffset.x);
if(position==320)
{
// Code Here
}
}
Use the sender parameter rather than whatever variable _scrollView referes to (which may not be hooked up correctly)
Also, don’t cast the contentOffset.x to an int, it’s really a CGFloat