https://github.com/pircate/rxfspagerview
FSPagerView+Rx
https://github.com/pircate/rxfspagerview
rxcocoa rxswift
Last synced: 10 months ago
JSON representation
FSPagerView+Rx
- Host: GitHub
- URL: https://github.com/pircate/rxfspagerview
- Owner: Pircate
- License: mit
- Created: 2018-07-17T14:19:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-31T11:04:42.000Z (almost 5 years ago)
- Last Synced: 2025-05-07T01:05:09.420Z (about 1 year ago)
- Topics: rxcocoa, rxswift
- Language: Swift
- Homepage:
- Size: 2.52 MB
- Stars: 9
- Watchers: 1
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RxFSPagerView
[](https://travis-ci.org/Pircate/RxFSPagerView)
[](https://cocoapods.org/pods/RxFSPagerView)
[](https://cocoapods.org/pods/RxFSPagerView)
[](https://cocoapods.org/pods/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](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'RxFSPagerView'
```
## Usage
```swift
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, gao497868860@163.com
## License
RxFSPagerView is available under the MIT license. See the LICENSE file for more info.