-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
72 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
Copyright (c) 2016 Ivan Bruel <[email protected]> | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 Ivan Bruel | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -7,13 +9,14 @@ 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 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. | ||
|
||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
# Cell-Rx | ||
Cell+Rx | ||
=========== | ||
|
||
[![CI Status](http://img.shields.io/travis/Ivan Bruel/Cell-Rx.svg?style=flat)](https://travis-ci.org/Ivan Bruel/Cell-Rx) | ||
[![Version](https://img.shields.io/cocoapods/v/Cell-Rx.svg?style=flat)](http://cocoapods.org/pods/Cell-Rx) | ||
[![License](https://img.shields.io/cocoapods/l/Cell-Rx.svg?style=flat)](http://cocoapods.org/pods/Cell-Rx) | ||
[![Platform](https://img.shields.io/cocoapods/p/Cell-Rx.svg?style=flat)](http://cocoapods.org/pods/Cell-Rx) | ||
**Cell+Rx** provides a similar API to [NSObject+Rx](https://github.com/RxSwiftCommunity/NSObject-Rx) but for cells who are reused along the way. | ||
|
||
## Usage | ||
I found myself creating `DisposeBag`s that were reset on the `prepareForReuse()` function which was pretty repetitive. | ||
|
||
To run the example project, clone the repo, and run `pod install` from the Example directory first. | ||
Instead of adding a new property to every cell, use this library to add it for you, to any subclass of `UITableViewCell` or `UICollectionViewCell`. | ||
|
||
## Requirements | ||
```swift | ||
thing | ||
.bindTo(otherThing) | ||
.addDisposableTo(rx_reusableDisposeBag) | ||
``` | ||
|
||
It'll work just like a property: when the instance is deinit'd, the `DisposeBag` gets disposed. It will also reset whenever the cell is reused by detecting `prepareForReuse()` calls. It's also a read/write property, so you can use your own, too. | ||
|
||
## Installation | ||
Installing | ||
---------- | ||
|
||
Cell-Rx is available through [CocoaPods](http://cocoapods.org). To install | ||
it, simply add the following line to your Podfile: | ||
####CocoaPods | ||
|
||
This works with RxSwift version 2, which is still prerelease, so you've gotta be fancy with your podfile. | ||
|
||
```ruby | ||
pod "Cell-Rx" | ||
pod 'Cell+Rx' | ||
``` | ||
|
||
## Author | ||
|
||
Ivan Bruel, [email protected] | ||
And that'll be 👌 | ||
|
||
## License | ||
License | ||
------- | ||
|
||
Cell-Rx is available under the MIT license. See the LICENSE file for more info. | ||
MIT License. |