{"id":19188807,"url":"https://github.com/miquido/noboilerplatetableviews","last_synced_at":"2026-06-17T03:31:27.642Z","repository":{"id":117573642,"uuid":"146883907","full_name":"miquido/NoBoilerplateTableViews","owner":"miquido","description":"The project was made by Miquido. https://www.miquido.com/","archived":false,"fork":false,"pushed_at":"2018-09-27T13:27:14.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T03:42:22.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miquido.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-31T11:34:35.000Z","updated_at":"2021-09-30T10:02:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"b65947a6-4736-4ba5-98ae-3d1119925857","html_url":"https://github.com/miquido/NoBoilerplateTableViews","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/miquido/NoBoilerplateTableViews","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquido%2FNoBoilerplateTableViews","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquido%2FNoBoilerplateTableViews/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquido%2FNoBoilerplateTableViews/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquido%2FNoBoilerplateTableViews/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miquido","download_url":"https://codeload.github.com/miquido/NoBoilerplateTableViews/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquido%2FNoBoilerplateTableViews/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34433085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T11:26:06.010Z","updated_at":"2026-06-17T03:31:27.628Z","avatar_url":"https://github.com/miquido.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://travis-ci.org/miquido/NoBoilerplateTableViews.svg?branch=master)\n\n# NoBoilerplateTableViews\n\n## Installation\n\nNoBoilerplateTableViews is available through Cocoapods. It depends on RxSwift and RxCocoa 4 in order to use BehaviorRelay to propagate data. To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'NoBoilerplateTableViews', :git =\u003e \"https://github.com/miquido/NoBoilerplateTableViews.git\"\n```\n\n## Usage \n\nThis library contains handy extensions for using ```UITableView```s, as well as protocols to automate implementation of simple, non-sectioned view controllers utilizing table views.\n\n### RxTableViewControllable\n\nFirstly, we want to create our ```UITableViewCell``` subclass:\n\n```swift\nclass SampleCell: UITableViewCell {\n    \n    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {\n        super.init(style: style, reuseIdentifier: reuseIdentifier)\n        // Required initializations\n    }\n    \n    required init?(coder aDecoder: NSCoder) {\n        fatalError(\"This init shouldn't be used\")\n    }\n    \n    func bind(to viewModel: SampleCellViewModel) {\n        // ...\n    }\n}\n```\n\nThen we need to create items with the data to fill all the cells:\n\n```swift\nstruct SampleCellViewModel {\n    // Properties..\n}\n```\n\nFinally, we create ```UIViewController``` that needs to display ```UITableView```. __It's very important that the properties from ```UITableViewWithRxConfigurable``` are declared in the class itself and tableView and disposeBag are stored properties__:\n\n```swift\nclass ViewController: UIViewController, UITableViewConstraintsConfigurable {\n\n    // MARK: - UITableViewWithRxConfigurable properties\n\n    var items: BehaviorRelay\u003c[SampleCellViewModel]\u003e = BehaviorRelay(value: [])\n    var disposeBag = DisposeBag()\n    var tableView = UITableView()\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        configureTableViewToFillFrame(in: view)\n        configureTableViewWithRx()\n    \n        // Feed UITableView with data (1 item in our case)\n        items.accept([ SampleCellViewModel(...) ])\n    }\n}\n\n// MARK: - Rx table view\n\nextension ViewController: UITableViewWithRxConfigurable {\n    \n    typealias Item = SampleCellViewModel\n    typealias Cell = SampleCell\n    \n    func configureCell(_ cell: SampleCell, withItem item: SampleCellViewModel) {\n        cell.bind(to: item)\n    }\n    \n    func itemSelected(_ item: SampleCellViewModel, at indexPath: IndexPath) {\n        print(\"Item at \\(indexPath.row) was selected.\")\n    }\n}\n```\n\nThis library uses RxSwift and RxCocoa, so to provide data we use ```BehaviorRelay```. When creating our controller we need to provide ```DisposeBag```, ```UITableView``` and ```BehaviorRelay``` as the data producer - ```RxCocoa``` needs to be included for that to work. Then using typealias we estabilish what cell and item's types are going to be and we provide a function to configure the cell with an item. There are also callbacks for tapping the cell.\n\n### Extensions\n\nThis section can be considered a small addition to the library. Firstly, to register the Cell's type or Header/Footer's type, we call:\n\n```swift\n// extension for registering cell\ntableView.register(SampleCell.self)\n\n// extension for registering header/footer\ntableView.register(SampleHeaderView.self)\n```\nIt must be noted that __this library allows only table view cells created from code, not from the NIBs.__\n\nLater if we want to dequeue a cell:\n\n```swift\nfunc tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -\u003e UITableViewCell {\n    // Extension for safely dequeing a cell\n    let cell: SampleCell = tableView.cell(for: indexPath)\n    cell.bind(to: items[indexPath.row])\n    return cell\n}\n```\n\nWe can obtain header/footer view in a similar manner:\n\n```swift\nfunc tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -\u003e UIView? {\n    // Extension for safely dequeing a header/footer\n    return tableView.headerFooterView(SampleHeaderView.self)\n}\n```\n\n### TODO\n- Configuring UITableView without the use of RxSwift\n- Support for protocol-based UIView for Empty View\n- Support for sections (headers/footers) in ```UITableView``` - currently ```NoBoilerplateTableViews``` works only with simple lists\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiquido%2Fnoboilerplatetableviews","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiquido%2Fnoboilerplatetableviews","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiquido%2Fnoboilerplatetableviews/lists"}