RxFSPagerView
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:
pod 'RxFSPagerView'
Usage
let items = Driver.of(["image0", "image1", "image2", "image3"])
items.drive(pagerView.rx.items(cellIdentifier: "FSPagerViewCell"))
{ _, item, cell in
cell.imageView?.image = UIImage(named: item)
}.disposed(by: disposeBag)
items.map({ $0.count }).drive(pageControl.rx.numberOfPages).disposed(by: disposeBag)
pagerView.rx.itemSelected.subscribe(onNext: { index in
debugPrint(index)
}).disposed(by: disposeBag)
pagerView.rx.modelSelected(String.self).subscribe(onNext: { image in
debugPrint(image)
}).disposed(by: disposeBag)
pagerView.rx.itemScrolled.asDriver().drive(pageControl.rx.currentPage).disposed(by: disposeBag)
Author
Pircate, [email protected]
License
RxFSPagerView is available under the MIT license. See the LICENSE file for more info.