Friday, June 28, 2013

UIWebView detect scrolling

Today I'm trying to show and hide a View depending on the scrolling direction of a UIWebView.
Unfortunately just setting the delegate of the UIWebView in the storyboard (or in the code) is not enough  to get the method

- (void)scrollViewDidScroll:(UIScrollView *)scrollView

called.

That's because its not the delegate of the UIWebView that you want in this case but the delegate of its containing UIScrollview. So in your init method just set the following and you're done.

[self.eventUIWebView.scrollView setDelegate:self];

No comments:

Post a Comment

Golang setup PATH

Quite recently we startet in the company to use and write some Go programs. I love Go. It's easy to learn, read and modify. One of the m...