Questions tagged [rx-cocoa]

238 questions
1
vote
1 answer

RxSwift - Filter data from tableview from UIPickerView

i try to filter data from my table View. When i select one value from picker View, The data suppose to filter based on the category and the table view should reload with filtered data. here i attach the code struct RecipeList { let id: Int let…
syafiqq aziz
  • 94
  • 2
  • 12
1
vote
1 answer

How to use tableView's datasource (numberOfRowsInSection) wirh RxSwift?

I'm using RxSwift, RxCocoa for my app and implemented a tableView. When It got priceData from viewModel for tableView, it showed full list of priceData. But I want to show only 50 counts at the first time and show more when I scroll it. Without…
1
vote
2 answers

How to throttle observable until a condition becomes true

I have a collection view in my app, and it would refresh with animation when there is new content or deletion. However, I don't want it to refresh while user is scrolling because it would cause jerking. I want to refresh the collection view only…
Henry Ngan
  • 572
  • 1
  • 4
  • 24
1
vote
1 answer

How to write getter and setter for HasDelegate protocol in RxSwift?

I am implementing HasDelegate protocol to the IWDeviceManager. In all the posts which I have read, no one has wrote getter & setter for this public var delegate property. The compiler is explicitly asking me to write getter & setter for public var…
Anirudha Mahale
  • 2,526
  • 3
  • 37
  • 57
1
vote
1 answer

Differentiate errorObserver with appropriate value in iOS RxSwift

I have a LoginViewModel and LoginViewController class. In LoginViewController there is 2 textfield userName, password, and a Login Button, when user click Login button username and password field is validated in LoginViewModel class, if it is empty…
Jasmine John
  • 873
  • 8
  • 12
1
vote
1 answer

RxSwift do not bind data to custom collection view cell

I created custom collectionViewCell to binding data from an obsersable to custom CollectionViewCell. I successfully bind data to a custom TableViewCell but I can't show the contents of data to custom collection view cell. Is there a problem with Rx…
mathema
  • 939
  • 11
  • 22
1
vote
2 answers

Driver is being triggered constantly between View Model and View Controller

Have an issue with a Driver on RxSwift. Have a view model who is listening to an initTrigger in a ViewController as follow. let initTrigger = rx.viewWillAppear .mapToVoid() .asDriverOnErrorJustComplete() This…
WedgeSparda
  • 1,161
  • 1
  • 15
  • 40
1
vote
1 answer

Does binding order matter when binding multiple operations to a single control event?

When binding two specific operations to a button tap, does execution order follow binding order? For example, in the following code, is there a way to tell what gets executed first? self.resetButton.rx.tap.bind(to:…
bedranfleck
  • 165
  • 2
  • 8
1
vote
3 answers

How do I add a control event to a custom button in RxCocoa?

How do I add an .tap method to a custom button, ie. .rx.tap in RxSwift/RxCocoa, so that I can bind the tap of the button to an observable. CircularButton.swift class UICircularButton: UIButton { override func layoutSubviews() { …
Samuel Kith
  • 109
  • 12
1
vote
1 answer

RxSwift MVVM tableview/collectionview with user input cells representing state

I have one request for any of you. I want to create collectionview/tableview which will have user inputs in cells. Mixture of values from those inputs would represent state. I want to observe that state and if some conditions are met, I want to…
beretis
  • 899
  • 1
  • 9
  • 24
1
vote
1 answer

How to create customer Observer Event using EventConvertible in RxSwift?

For example in the following code the default ObserverType has an event onError where Swift.Error object can be passed. How can I create custom ObserverType / Event so that I'll be able to supply an object of a custom class. class LoginService:…
Pawan Joshi
  • 1,581
  • 3
  • 20
  • 40
1
vote
2 answers

combined textfields result if all are not empty RxSwift

Im trying to combine the inputs of all the textfield and check if it has an input but upon observing combine latest only subscribed once. Is there any other way to check the textfields if they are empty using rxswift? those the OTP textfields let…
negative15
  • 25
  • 1
  • 5
1
vote
2 answers

Reactive Swift consume live data from API - need basic example

I’m new to RxSwift and I’m looking for a basic example of how to print in console live data streaming from an backend. I have a backend which is streaming some dummy data every 1 second, I can see it with a curl request and I want to be able to…
ibercode
  • 1,264
  • 3
  • 17
  • 29
1
vote
1 answer

How to use flatMapLatest on a driver with RxSwift

I'm trying to fetch some data from the network whenever the location of my user changes. struct CityService { private init() {} static let shared = CityService() lazy var nearbyCities: Driver<[City]> = { return…
Tieme
  • 62,602
  • 20
  • 102
  • 156
1
vote
1 answer

2 way binding in UITableView using RxSwift

I am using MVVM pattern with RxSwift, RxCocoa, RxDataSources. I have successfully populated the UITableView with array of PaletteViewModel present in ListViewModel by using RxDataSource but it's one way binding. I want to achieve what I have shown…