React-like API for UITableView & UICollectionView
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github [Docs] Add Contributing Guidelines Jan 26, 2018
Example Make section `diffingKey` parameter required (#147) Oct 16, 2018
Guides More updates to getting started (#106) Feb 6, 2018
Pods Upgrade swiftlint 0291 (#151) Dec 10, 2018
ReactiveLists.xcodeproj Upgrade ReactiveLists for Swift 4.2; drop iOS 9 support (#144) Sep 20, 2018
ReactiveLists.xcworkspace run pod install Apr 26, 2018
Resources png crush Jan 28, 2018
Sources [Scout] Use allSatisfy() (#150) Dec 10, 2018
Tests Upgrade swiftlint 0291 (#151) Dec 10, 2018
docs Prepare 0.3.0 release (#146) Sep 20, 2018
scripts [Docs] initial generation (#80) Jan 26, 2018
.codecov.yml Create .codecov.yml (#89) Jan 26, 2018
.gitignore CocoaPods/Gemfile updates (#129) Aug 17, 2018
.swiftlint.yml Upgrade swiftlint 0291 (#151) Dec 10, 2018
.travis.yml Upgrade ReactiveLists for Swift 4.2; drop iOS 9 support (#144) Sep 20, 2018
CHANGELOG.md Fix changelog typo (#152) Dec 10, 2018
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Jan 22, 2018
Dangerfile [Danger] Fix milestone warning Jul 9, 2018
Gemfile CocoaPods/Gemfile updates (#129) Aug 17, 2018
Gemfile.lock CocoaPods/Gemfile updates (#129) Aug 17, 2018
LICENSE Create LICENSE Feb 5, 2018
Podfile Upgrade swiftlint 0291 (#151) Dec 10, 2018
Podfile.lock Upgrade swiftlint 0291 (#151) Dec 10, 2018
README.md Update README for 0.1.1 Jul 6, 2018
ReactiveLists.podspec Upgrade DifferenceKit to 0.7.2 (#148) Oct 22, 2018

README.md

React-like API for UITableView & UICollectionView

Build Status Version Status license MIT codecov Platform

ReactiveLists provides a React-like API for UITableView and UICollectionView that makes it easy to write stateless code that generates user interfaces.

In our experience this can make UI code significantly easier to read and maintain. Instead of spreading the definition of your content over various data source methods, you can define the content concisely. The table or collection content and layout are immediately obvious by scanning over the source code.

You can read more about the origins of this library in our announcement blog post.

Features

  • React-like declarative API for UITableView and UICollectionView
  • Automatic UI updates, whenever your models change

Example

// Given a view controller with a table view

// 1. create cell models
let cell0 = ExampleTableCellModel(...)
let cell1 = ExampleTableCellModel(...)
let cell2 = ExampleTableCellModel(...)

// 2. create section models
let section0 = ExampleTableSectionViewModel(cellViewModels: [cell0, cell1, cell2])

// 3. create table model
let tableModel = TableViewModel(sectionModels: [section0])

// 4. create driver
self.driver = TableViewDriver(tableView: self.tableView, tableViewModel: tableModel)

// 5. update driver with new table model as it changes
let updatedTableModel = self.doSomethingToChangeModels()
self.driver.tableViewModel = updatedTableModel

// self.tableView will update automatically

Project Status

An early version of the UITableView support has been shipping in the PlanGrid app since late 2015 and is now used accross wide parts of the app. The support for UICollectionView is less mature as we only use UICollectionView in very few places.

Feature Status
UITableView support
UICollectionView support ⚠️ Experimental

Vision

For long-term goals and direction, please see VISION.md.

Getting Started

Read our Getting Started Guide to learn how to use ReactiveLists.

Documentation

Read our documentation here. Generated with jazzy. Hosted by GitHub Pages.

Generating docs

$ ./scripts/gen_docs.sh

Requirements

  • Xcode 9.4+
  • Swift 4.1+
  • iOS 9+

Installation

CocoaPods (recommended)

use_frameworks!

# For latest release in CocoaPods
pod 'ReactiveLists'

# Latest on master branch
pod 'ReactiveLists', :git => 'https://github.com/plangrid/ReactiveLists.git', :branch => 'master'

Contribute

Please read and follow our Contributing Guide and our Code of Conduct.

License

ReactiveLists is released under an MIT License. See LICENSE for details.

Copyright © 2018-present PlanGrid, Inc.