Search code examples
iosobjective-ccocoa-touchuiscrollviewdelegate

Does scrollViewWillScrollToTop: exist?


Apple documentation says that scrollViewWillScrollToTop: will be called as part of the UIScrollViewDelegate protoco. However, this method doesn't seem to exist even when I recursively grep through the /Developer folder. I don't see where this method is being called nor its prototype. Any hints?


Solution

  • Are you referring to this?

    This gesture works on a single visible scroll view; if there are multiple scroll views (for example, a date picker) with this property set, or if the delegate returns NO in scrollViewWillScrollToTop:, UIScrollView ignores the request. After the scroll view scrolls to the top of the content view, it sends the delegate a scrollViewDidScrollToTop: message.

    It's a typo in the docs. They meant to say scrollViewShouldScrollToTop:. You can see they are mentioning returning a BOOL value, and will... delegate methods usually don't return anything. The ones starting with should... on the other hand do.

    I suggest you report this by clicking the "It's good, but..." link in the footer of the doc. I will do the same.

    screenshot of documentation footer