> ## Content Index
> Fetch the complete content index at: https://developerinsider.co/llms.txt
> Use this file to discover other available public pages before exploring further.

# Use UIRefreshControl in any UIScrollView(UICollectionView, WebView)
- URL: https://developerinsider.co/how-to-use-uirefreshcontrol-for-any-uiscrollview-uicollectionview/
- Published: 2020-05-31T05:12:31.000Z
- Updated: 2020-12-05T11:05:46.000Z
- Author: Vineet Choudhary
- Tags: Xcode, iOS, UIScrollView, WebView, Tips

Apple documentation shows us how we can use an `UIRefreshControl` in an `UITableViewController`, but do you know, we can add it to any `UIScrollView `?

```swift
let refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: #selector(handleRefresh), for: .valueChanged)
scrollView.addSubview(refreshControl)

```

In a similar way, we can add `UIRefreshControl` to a `WKWebView`.

```swift
let refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: #selector(handleRefresh), for: .valueChanged)
webView.scrollView.addSubview(refreshControl)

```