1

I am encountering a strange issue that I've never seen before. I am trying to perform some math in the scrollViewDidEndDragging method, using the contentOffset of the UICollectionView. However, the contentOffset is being returned as {0,0}. For illustrative purposes, here is the method and console log:

func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool) {
    NSLog("Scrollview content offset %f %f", scrollView.contentOffset.x, scrollView.contentOffset.y)
    NSLog("ScrollView: %@", scrollView)  
}

enter image description here

As you can see, the underlying UICollectionView is printing out a contentOffset of {144.5, 0} while trying to access the contentOffset directly is printing out 0.000000 0.000000. Any ideas?

Scott Lieberman
  • 289
  • 2
  • 11

0 Answers0