PaginationController 1.0.0

PaginationController 1.0.0

Maintained by Lukas Würzburger.

  • By
  • Lukas Würzburger


Swift Version Build Status CocoaPods Compatible License MIT


✍️ Description

The PaginationController provides the logic to paginate through a list with limited request results. It also provides a TableViewPaginationController that adds and removes a loading view to the tableFooterView.

🖥 Example

class ViewController: UITableViewController {

    var items: [String] = []

    override func viewDidLoad() {

        paginationController = TableViewPaginationController(tableView: tableView) { previousPage, callback in

            // Imagine an API call being made here.
            self.loadMore(after: previousPage) { page in
                self.items += page?.results ?? []

🎟 Demo

Pagination Controller Demo

You can find this demo app in this repository.

🔨 Customization

Custom Loading View:

If you want to show your own loading view you can use any UIView conforming to the LoadingAnimatable protocol described here.

Pass it to the initializer:

paginationController = TableViewPaginationController(loadingView: MyLoadingView(), ...)

Or set the property:

paginationController.loadingView = MyLoadingView()

Check out the Demo

💻 How to use

PaginationController is available on Cocoapods. Just put following line in your Podfile:

pod 'PaginationController'

Swift Package Manager:
Add the following to your Package.swift file:

dependencies: [
    .package(url: "", from: "1.0.0")

⚠️ Requirements

  • Swift 5+
  • iOS 10+
  • Xcode 11+

💪 Contribute

Issues and pull requests are welcome.