I'm trying to use UIPickerView with RxSwift. Is there a way to wrap the UIPickerView dataSource and delegate methods to be used with Observables? I'm trying to do something like
dataSequence
.bindTo(pickerView.rx_itemsWithDataSource(dataSource))
I see there is a premade library for UITableview https://github.com/RxSwiftCommunity/RxDataSources but I'm wondering if there's an easy way to generalize this for other things that require dataSource and delegate using RxSwift.
The basic RxCocoa pod which you should have imported with RxSwift in the podfile should already had this.
In case you didn't import that in your podfile, add
pod 'RxCocoa', '~> 3.0'
Proceed then to bind the delegate like you would with a normal TableView. I didn't see any dataSource observable for UIPickerView though, so you should check that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With