How to Pull Up Refresh in UITableView or UICollectionView

Step 1 :-  Create Object


var pullRefresh : UIRefreshControl = UIRefreshControl()

Step 2 :- initialise with Controller

 pullRefresh.addTarget(self, action: #selector(self.pullRefreshView), for: .valueChanged)
 pullRefresh.tintColor = UIColor.clear
 self.tblOjbect!.addSubview(pullRefresh)
 self.tblOjbect!.alwaysBounceVertical = true

 self.tblOjbect!.bounces = true

Step 3:- Create Objective Functions


@objc func pullRefreshView()
{
    pullRefresh.endRefreshing()
    // Write here what you what on pull Up Refresh

}


Comments

Popular posts from this blog

Windows Keys

how to display popover in TableView cell in swift

Important extensions while create a new App in swift