Closed yohannes closed 7 years ago
var refreshControl: UIRefreshControl!
//in viewDidLoad self.refreshControl = UIRefreshControl() self.refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh notes" self.refreshControl.addTarget(self, action: "loadEntries", forControlEvents: .valueChanged) self.tableView.addSubview(self.refreshControl)
//place the following in the function loadEntries after weakSelf.tableView.reloadData self.refreshControl.endRefreshing()
Solution: https://github.com/yoha/Thoughtless/commit/67ea94ff1fdbf4710bb2ce92dde5f25955384f19
var refreshControl: UIRefreshControl!
//in viewDidLoad self.refreshControl = UIRefreshControl() self.refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh notes" self.refreshControl.addTarget(self, action: "loadEntries", forControlEvents: .valueChanged) self.tableView.addSubview(self.refreshControl)
//place the following in the function loadEntries after weakSelf.tableView.reloadData self.refreshControl.endRefreshing()