Skip to content

Instantly share code, notes, and snippets.

@siuying
Created August 8, 2017 09:52
Show Gist options
  • Select an option

  • Save siuying/3c5d8884c48e61dd612272f39d2601b9 to your computer and use it in GitHub Desktop.

Select an option

Save siuying/3c5d8884c48e61dd612272f39d2601b9 to your computer and use it in GitHub Desktop.
RxDataSources
Pod::Spec.new do |s|
s.name = "RxDataSources"
s.version = "1.0.4"
s.summary = "This is a collection of reactive data sources for UITableView and UICollectionView."
s.description = <<-DESC
This is a collection of reactive data sources for UITableView and UICollectionView.
It enables creation of animated data sources for table an collection views in just a couple of lines of code.
```swift
let data: Observable<Section> = ...
let dataSource = RxTableViewSectionedAnimatedDataSource<Section>()
dataSource.cellFactory = { (tv, ip, i) in
let cell = tv.dequeueReusableCell(withIdentifier: "Cell") ?? UITableViewCell(style:.Default, reuseIdentifier: "Cell")
cell.textLabel!.text = "\(i)"
return cell
}
// animated
data
.bind(to: animatedTableView.rx.items(dataSource: dataSource))
.disposed(by: disposeBag)
// normal reload
data
.bind(to: tableView.rx.items(dataSource: dataSource))
.disposed(by: disposeBag)
```
DESC
s.homepage = "https://github.com/ReactiveX/RxSwift"
s.license = 'MIT'
s.author = { "Krunoslav Zaher" => "krunoslav.zaher@gmail.com" }
s.source = { :git => "https://github.com/RxSwiftCommunity/RxDataSources.git", :tag => s.version.to_s }
s.requires_arc = true
s.ios.deployment_target = '8.0'
s.tvos.deployment_target = '9.0'
s.source_files = 'Sources/**/*.swift'
s.dependency 'RxSwift', '>= 3.0'
s.dependency 'RxCocoa', '>= 3.0'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment