jen007
jen007

Reputation: 1589

How to add Pull-to-refresh on UIView (not a UITableView, UICollectionView, UIScrollView)

So I'm pretty new to iOS development, and want to add the pull-to-refresh behavior to the UIView. Is that possible? If so, how to implement it?

I see that there're a couple of examples of showing UIRefreshControl for UITableView, UIScrollView, and UICollectionView. ex1

Is it possible to have the pull-to-refresh behavior for UIView only?

Upvotes: 2

Views: 692

Answers (1)

Amais Sheikh
Amais Sheikh

Reputation: 453

UIScrollView does have a build in refresh control, you may use a uiscrollview and pin it in the view of your view controller. This way you would be able to use the default build in uirefreshcontrol.

If you don't want to use the build in refresh control, then you would have to use pan gesture and would have to manually implement all the functionality, but it is not wise to reinvent the wheel.

Upvotes: 2

Related Questions