Pull To Refresh iOS Swift

Mr.Javed Multani
1 min readOct 3, 2020

You can achieve this by using few lines of code. So why you are going to stuck in third party library or UI.

Pull to refresh is built in iOS. You could do this in swift like

var refreshControl = UIRefreshControl()override func viewDidLoad() {
super.viewDidLoad()
refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh")
refreshControl.addTarget(self, action: #selector(refresh(_:)), for: UIControl.Event.valueChanged)
tableView.addSubview(refreshControl) // not required when…

--

--

Mr.Javed Multani

Software Engineer | Certified ScrumMaster® (CSM) | UX Researcher | Youtuber | Tech Writer