项目作者: Pircate

项目描述 :
FSPagerView+Rx
高级语言: Swift
项目地址: git://github.com/Pircate/RxFSPagerView.git
创建时间: 2018-07-17T14:19:10Z
项目社区:https://github.com/Pircate/RxFSPagerView

开源协议:MIT License

下载


RxFSPagerView

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

RxFSPagerView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

  1. pod 'RxFSPagerView'

Usage

  1. let items = Driver.of(["image0", "image1", "image2", "image3"])
  2. items.drive(pagerView.rx.items(cellIdentifier: "FSPagerViewCell"))
  3. { _, item, cell in
  4. cell.imageView?.image = UIImage(named: item)
  5. }.disposed(by: disposeBag)
  6. items.map({ $0.count }).drive(pageControl.rx.numberOfPages).disposed(by: disposeBag)
  7. pagerView.rx.itemSelected.subscribe(onNext: { index in
  8. debugPrint(index)
  9. }).disposed(by: disposeBag)
  10. pagerView.rx.modelSelected(String.self).subscribe(onNext: { image in
  11. debugPrint(image)
  12. }).disposed(by: disposeBag)
  13. pagerView.rx.itemScrolled.asDriver().drive(pageControl.rx.currentPage).disposed(by: disposeBag)

Author

Pircate, gao497868860@163.com

License

RxFSPagerView is available under the MIT license. See the LICENSE file for more info.