t0roea
Last Updated: December 26, 2018
·
9.142K
· angrauel

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];

2 Responses
Add your response

672

very useful.

over 1 year ago ·
10669

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 ·