Voulez-vous ajouter le pull pour actualiser en bas de tableview.Comment faire tirer à actualiser dans tableview buttom dans iOS swift
D'abord veulent montrer les nombres tableview 100 à 90.
Ensuite, ajoutez la traction pour se rafraîchir en bas de tableview. Tirez-le pour afficher 80 à 70, puis actualisez 70 à 60, puis actualisez 50 à 40 ... etc. Final 1 à 10 signifie que l'affichage est arrêté "aucune donnée disponible". comment y parvenir. aidez-moi merci avance.
Voici mon code.
@IBOutlet weak var dataTbl: UITableView!
var numbers: [Any] = ["90","91","92","93","94","95","96","97","98","99","100"] // display first 100 to 90.
Chargé dans la vue de table.
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.numbers.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell:UITableViewCell = self.dataTbl.dequeueReusableCell(withIdentifier: cellReuseIdentifier) as UITableViewCell!
cell.textLabel?.text = self.numbers[indexPath.row] as? String
return cell
}
recherché dans Google pour ajouter le rafraîchissement dans buttom de tableview. J'ai eu ce code.
let spinner = UIActivityIndicatorView(activityIndicatorStyle: .gray)
spinner.color = UIColor.darkGray
spinner.hidesWhenStopped = true
tableView.tableFooterView = spinner
show spinner utilisant
spinner.startAnimating()
cacher à l'aide
spinner.stopAnimating()
En utilisant ce code comment faire tirer pour rafraîchir me aider.
mais ne peut pas y parvenir. - signifie quoi ... –
ce que vous voulez faire avec le code ci-dessus? – shahnilay86
où vous appelez ceci 'let spinner = UIActivityIndicatorView (activityIndicatorStyle: .gray) spinner.color = UIColor.darkGray' –