UITableView infinite scrolling a lot simpler than you knew: UITableViewDataSourcePrefetching

1) prefetchRowsAt

2) cancelPrefetchingRowsAt

Demo: Number API

  1. Create a new Xcode project with the iOS template and in your main storyboard, drag and drop a UITableView, attaching its constraints straight to the borders. Don't forget to drag an IBOutlet to your ViewController swift file:
struct NumberModel: Decodable {let text: String?let number: Int?let found: Bool?let type: String?}
Append the tasks to this array
Fetching data for a single number

Pagination logic

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pedro Alvarez

Pedro Alvarez

641 Followers

iOS developer- WWDC19 scholarship winner- Blockchain enthusiast