Sto cercando di implementare i dati di caricamento dal mio backend con l'impaginazione. Ho visto questo, ma carica tutti i dati, tutto il tempo. È questo il modo giusto o sto facendo qualcosa di sbagliato?Impaginazione UITableView - Aggiornamento inferiore per caricare nuovi dati in Swift
Grazie in anticipo.
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell
print(indexPath.row)
if (indexPath.row + 1 < self.TotalRowsWithPages) {
cell.textLabel?.text = "\(self.myarray!.[indexPath.row].body)"
} else {
cell.textLabel?.text = "Loading more data...";
// User has scrolled to the bottom of the list of available data so simulate loading some more if we aren't already
if (!self.isLoading) {
self.isLoading = true;
self.TotalRowsWithPages = self.TotalRowsWithPages + self.PageSize
self.getmoredata()
}
}
return cell
}
Non funziona in Swift 4 –
@UtkuDalmaz Puoi dirmi che cosa non funziona esattamente? –
L'operatore binario '==' non può essere applicato agli operandi di tipo 'UIScrollView' e '_' –