t0roea
Last Updated: February 25, 2016
·
6.975K
· angrauel
9c18132b3cee0bda425e22e4af300d28

UIRefreshControl in any UIScrollView

Apple documentation only explains how to use an UIRefreshControl in an UITableViewController, but what do you do if you want to add it to any UIScrollView?

UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged];
[self.scrollView addSubview:refreshControl];
Say Thanks
Respond

2 Responses
Add your response

672
E5a1d8b4c0856566e5aba753463cb80a

very useful.

over 1 year ago ·
10669
Me3 normal

Hi Andreas,
I'm facing a problem with this.
I'm adding content in my scrollview on refreshing, and in the process, my contentview of the scrollview resets to a height of 1pt and resizes to a bigger area.
Now, when I pull down to refresh, the UIRefreshControl is missing!

over 1 year ago ·