Latest 0.1.2
Homepage https://github.com/kciter/RxAutoUpdater
License MIT
Platforms ios 8.0, requires ARC
Dependencies RxCocoa
Frameworks UIKit, Foundation
Authors

Version
License
Platform
Build Status

Auto update to data for UITableView/UICollectionView

warning: RxAutoUpdater can’t respond to the cells in various shapes or multiple section yet. See ToDo.

Preview

$ pod try RxAutoUpdater
Example In Action
var items: TableItem = ["Lee Sun-Hyoup",
                        "kciter",
                        "RxSwift",
                        "Reactive"]

tableView.rx_autoUpdate(items, 
                        animationTypes: animationTypes, 
                        identifier: "Cell") { index, cell, item in
    cell.textLabel?.text = item
}.addDisposableTo(disposeBag)

addButton.rx_tap
    .subscribeNext {
        self.items.append("Appended")
    }.addDisposableTo(disposeBag)

removeButton.rx_tap
    .subscribeNext {
        self.items.removeLast()
    }.addDisposableTo(disposeBag)

tableView.rx_itemSelected
    .subscribeNext { indexPath in
        self.items[indexPath.row] = "Changed!"
    }.addDisposableTo(disposeBag)
RxAutoUpdater

Requirements

  • iOS 7.0+
  • Swift 2.2
  • Xcode 7

Installation

  • CocoaPods

    use_frameworks!
    pod "RxAutoUpdater"
  • Manually
    • To install manually the RxAutoUpdator in an app, just drag the Sources/*.swift file into your project.

Simple Usage

UITableView

var items: TableItem<String> = ["Item1", "Item2", "Item3"]
tableView.rx_autoUpdate(items, identifier: "Cell") { index, cell, item in
    cell.textLabel?.text = item
}.addDisposableTo(disposeBag)
  • Change animation type
    let animationTypes = RxTableViewAnimationType(insertAnimation: .Left, 
                                              deleteAnimation: .Right, 
                                              reloadAnimation: .None)
    tableView.rx_autoUpdate(items, 
                        animationTypes: animationTypes, 
                        identifier: "Cell") { index, cell, item in
    cell.textLabel?.text = item
    }.addDisposableTo(disposeBag)

UICollectionView

var items: CollectionItem<UIColor> = [UIColor.blackColor(),
                                      UIColor.yellowColor(),
                                      UIColor.redColor(),
                                      UIColor.greenColor(),
                                      UIColor.brownColor()]

collectionView.rx_autoUpdate(items, identifier: "Cell") { index, cell, item in
    cell.backgroundColor = item
}.addDisposableTo(disposeBag)

ToDo

  • [ ] Multiple Section
  • [ ] DataSource Customize

License

The MIT License (MIT)

Copyright (c) 2016 Lee Sun-Hyoup

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Latest podspec

{
    "name": "RxAutoUpdater",
    "version": "0.1.2",
    "summary": "Auto update to data for UITableView/UICollectionView",
    "homepage": "https://github.com/kciter/RxAutoUpdater",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "kciter": "[email protected]"
    },
    "source": {
        "git": "https://github.com/kciter/RxAutoUpdater.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Sources/*.{swift}",
    "frameworks": [
        "UIKit",
        "Foundation"
    ],
    "dependencies": {
        "RxCocoa": [
            "~> 2.5"
        ]
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This