Latest 1.0.7
License MIT
Platforms ios 10.0

Loading remote data was never this easy



  • [x] Automatically loads more when scrolling 🚀
  • [x] Pull to refresh support 🏓
  • [x] Works with any UITableView! 🎯
  • [x] Error handling 🕸
  • [x] Custom view and sub-classing 🎨


pod 'AZRemoteTable'

Or simply drag and drop Sources folder to your project.


Step #1: Create a Data Source

class CustomRemoteDataSource: AZRemoteTableDataSource {

    //An array in which we will store the data.
    fileprivate var items: [String] = []

    /// Helper function to add items.
    public func addItems(items: [String]){
        for item in items { self.items.append(item) }

    /// Helper function to clear items.
    public func clearItems() {

    // MARK: - AZRemoteTableDataSource

    override func cellForRowAt(_ tableView: UITableView, indexPath: IndexPath) -> UITableViewCell {
        //simple implementation of cellForRowAt:
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell")!
        cell.textLabel?.text = items[indexPath.row]
        return cell

    override func numberOfRowsInSection(_ tableView: UITableView, section: Int) -> Int {
        //return the number of items currently held.
        return items.count

Step #2: Create a Delegate

class CustomRemoteDelegate: AZRemoteTableDelegate {
    override func tableView(_ tableView: UITableView,
                            didRequestPage page: Int,
                            usingRefreshControl: Bool) {

        // Make an API call.
        APIManager.shared.loadData(id: "a9dd9e00-55f8-4ce8-8ada-8e933d052e3a",
                                   token: "b54695d5-6f98-442f-9b39-4509fcd8aacd",
                                   page: page,
                                   itemsPerPage: 30) { (message, data, error) in

            //check for errors
            if error {
                //error found, notify table
            }else {
                //all good, data fetched, add it to the data source.
                let dataSource = tableView.remote.dataSource as? CustomRemoteDataSource

                //clear all items if we used pull to refresh
                if usingRefreshControl { dataSource?.clearItems() }

                //update data source
                dataSource?.addItems(items: data)

                //notify table that we are done, and if we have more data to load.
                tableView.remote.notifySuccess(hasMore: true)

Step #3: Use it in your controller

class ViewController: UIViewController {

    @IBOutlet weak var tableView: UITableView!

    let delegate = CustomRemoteDelegate()
    let dataSource = CustomRemoteDataSource()

    override func viewDidLoad() {
        tableView.delegate = delegate
        tableView.dataSource = dataSource

Latest podspec

    "name": "AZRemoteTable",
    "version": "1.0.7",
    "summary": "A framework that makes loading remote data into a table view an easy task.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Antonio Zaitoun": "[email protected]"
    "platforms": {
        "ios": "10.0"
    "source": {
        "git": "",
        "tag": "1.0.7"
    "source_files": "Sources/*.swift"

Pin It on Pinterest

Share This