Author Topic: UIWrapContent scroll direction detection  (Read 2699 times)

MaxUylings

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 23
    • View Profile
UIWrapContent scroll direction detection
« on: August 08, 2014, 05:12:42 AM »
Hello,

I'm trying to create a custom Facebook friend picker. At the moment almost everything works the way I want it to, except for one thing. I want that when you scroll down and the picker goes from "Angie" to "Bob" that there is a separator with the letter "B". This separator needs to have a different size compared to the other cells in the scrollview. This is working when you scroll down because I check when the first letter changes and at that point I change the cells settings. The problem is when I scroll back up. Because when I scroll back up the change in the first letter is between the "B" and "Angie" and because of that the cell with "Angie" gets changed. I was wondering if there is a way to check if it is scrolling up or down because if I could check that I would be able to change the settings of the "B" instead of "Angie".
Thanks for the help in advance :)

Kind Regards,
Max Uijlings

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIWrapContent scroll direction detection
« Reply #1 on: August 08, 2014, 08:55:01 AM »
Wrap content isn't the one that does the moving. Scroll view is what moves and UIScrollView.currentMomentum tells you which way it's moving.