Sectional 0.0.2

Sectional 0.0.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2016
SPMSupports SPM

Maintained by Cameron Pulsford.



Sectional 0.0.2

  • By
  • Cameron Pulsford

DataSource

A quick example:

import UIKit
import DataSource

class TableViewController: UITableViewController, TableViewDataSourceDelegate {

    private let dataSource = DataSource<DataItem>()

    override func viewDidLoad() {
        super.viewDidLoad()
        dataSource.configure(tableView: tableView, delegate: self)
        dataSource.appendSection(["Item 1", "Item 2", "Item 3"])
    }

    func configureCell(cell: UITableViewCell, atIndexPath indexPath: NSIndexPath) {
        guard let item = dataSource.itemForIndexPath(indexPath) else {
            return
        }

        cell.textLabel?.text = item.title
    }
}