How to add pull to refresh to a table view or collection view?
Add-Pull-to-Refresh-in-TableView-or-CollectionView
viewDidLoad() let refreshControl = UIRefreshControl() refreshControl. addTarget(self, action: #selector(doSomething), for: . valueChanged) // this is the replacement of implementing: "collectionView. addSubview(refreshControl)" collectionView.