Skip to content

Commit 7e35d4a

Browse files
committed
Adds animation.
1 parent 266cc6c commit 7e35d4a

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

README.md

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,12 @@ The problem is even bigger when table view or collection view needs to display a
1010
This project makes it super easy to just write
1111

1212
```swift
13-
dataSequence
13+
Observable.just([MySection(header: "title", items: [1, 2, 3])])
1414
.bindTo(tableView.rx_itemsWithDataSource(dataSource))
1515
.addDisposableTo(disposeBag)
1616
```
1717

18-
where data source is defined as
19-
20-
```
21-
let dataSource = RxTableViewSectionedReloadDataSource<MySection>()
22-
dataSource.cellFactory = { (tv, ip, i) in
23-
let cell = tv.dequeueReusableCellWithIdentifier("Cell") ?? UITableViewCell(style:.Default, reuseIdentifier: "Cell")
24-
cell.textLabel!.text = "\(i)"
25-
return cell
26-
}
27-
```
28-
29-
### Animated table and collection view updates
30-
31-
**For the animated data sources to be able to detect identity and changes of objects, your section needs to conform to `AnimatableSectionModelType` or you can just use `AnimatableSectionModel`. Demonstration how to use them and implement `AnimatableSectionModelType` is contained inside the Example app.**
32-
33-
In case you want to use animated data sources, just replace
34-
35-
`let dataSource = RxTableViewSectionedReloadDataSource<MySection>()` with <br/>`let dataSource = RxTableViewSectionedAnimatedDataSource<MySection>()`
36-
37-
and
38-
39-
` .bindTo(tableView.rx_itemsWithDataSource(dataSource))` with <br/> `.bindTo(tableView.rx_itemsAnimatedWithDataSource(dataSource)) `
18+
![RxDataSources example app](https://raw.githubusercontent.com/kzaher/rxswiftcontent/rxdatasources/RxDataSources.gif)
4019

4120
## Installation
4221

@@ -46,7 +25,7 @@ and
4625

4726
Podfile
4827
```
49-
pod 'RxDataSources', '~> 0.4'
28+
pod 'RxDataSources', '~> 0.7'
5029
```
5130

5231
### Carthage

0 commit comments

Comments
 (0)