Change Pull To Refresh Activity Indicator

Alec.

I have an ActivityIndicator on my tableView which appears when I pull to refresh.

I was wondering if I can change the color of the spinning indicator, here is my implimentation:

override func viewDidLoad() {
     refreshData()
    super.viewDidLoad()
    self.refreshControl?.addTarget(self, action: #selector(handleRefresh(refreshControl:)), for: UIControlEvents.valueChanged)

}

func handleRefresh(refreshControl: UIRefreshControl) {
    self.tableView.reloadData()
    self.refreshData()
    sleep(2)
    refreshControl.endRefreshing()

}

enter image description here

Nirav D

Simply change the tintColor of refreshControl

self.refreshControl.tintColor = .red

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related