Questions tagged [rx-cocoa]
238 questions
1
vote
1 answer
RxSwift MVVM Validate Form on Button Submit then Make API Request
I'm new to RxSwift and attempting to do as the title states with an MVVM input output approach.
I can't figure out the best approach to do the following.
Validate the phoneNumberTextField values when submitButton is tapped
Stop the Alamofire…

morcutt
- 3,739
- 8
- 30
- 47
1
vote
1 answer
RxSwift + canMoveRowAt
I'm using RxSwift (RxCocoa) to populate my tableView cells
viewModel.cellsDriver.drive(tableView.rx.items) { ... }
This way I have no access to tableView's dataSource's method
func tableView(_ tableView: UITableView, canMoveRowAt indexPath:…

Adam Smaka
- 5,977
- 3
- 50
- 55
1
vote
1 answer
Handle Connection Error in UITableView Binding (Moya, RxSwift, RxCocoa)
I'm using RxCoCoa and RxSwift for UITableView Biding.
the problem is when Connection lost or other connection errors except for Server Errors(I handled them) my app crash because of binding error that mentioned below. my question is how to handle…

Mohsen mokhtari
- 2,841
- 1
- 30
- 39
1
vote
0 answers
Unit testing Rx binding with UITextView
I have a ControlProperty binding like this in my UIViewController:
textView.rx.text.orEmpty.asObservable()
.bind(to: viewModel.descriptions)
.disposed(by: disposeBag)
, where viewModel.descriptions is of type BehaviorRelay.
In a TDD…

rgal75
- 151
- 6
1
vote
1 answer
How to implement in RXswift and RXCocoa of UITableView Inside of tableview cell?
I'm new to RXswift and currently working in a project that requires rxswift with UITableView inside of UITableViewCell
Below are some of the codes I've done so far, but every time scroll up/down, it doesn't show the right value
var disposeBag =…

Keith Randell Gapusan
- 83
- 2
- 8
1
vote
2 answers
RxSwift: Why does flatMapLatest never execute onCompleted()?
In my Swift UIViewController, I'm attempting to subscribe to a class member of type Variable, run it through a flatMapLatest call, and then have the onCompleted() call in the flatMapLatest observable execute on all subscribers. However, while…

Nickersoft
- 684
- 1
- 12
- 30
1
vote
0 answers
Generic parameter 'Self' could not be inferred in RxDataSources
I am trying RxDataSources https://github.com/RxSwiftCommunity/RxDataSources for simple TableView
class ViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
let disposeBag = DisposeBag()
override func…

moonvader
- 19,761
- 18
- 67
- 116
1
vote
1 answer
Observing multiple controlEvent causes `Reentrancy anomaly was detected.` warning message
I am new in RxSwift and today I face with a problem which I can't solve. I want to observe to controlEvents in UITextField.
Code:
textField.rx
.controlEvent([.editingDidEndOnExit, .editingDidEnd])
.subscribe(onNext: { [weak self] in
…

Kamil Harasimowicz
- 4,684
- 5
- 32
- 58
1
vote
1 answer
RxSwift bind to with animation with RxCocoa
I have a UIStepper value binded to a UILabel text:
unitsStepper.rx.value.asObservable()
.map { Int($0).description }
.bind(to: stepperCountLabel.rx.text)
.disposed(by: rx.disposeBag)
And i would like to animate the label…

Godfather
- 4,040
- 6
- 43
- 70
1
vote
0 answers
Keyboard in RxCocoa
I have some code like this:
let search = searchCityName.rx.text
.filter { ($0 ?? "").count > 0 }
.flatMapLatest { text in
return ApiController.shared.currentWeather(city: text ?? "Error")
…

Cuong Nguyen
- 376
- 1
- 5
- 8
1
vote
1 answer
Why `NotificationCenter+Rx` is in RxCocoa not RxSwift
Since NotificationCenter is a part of Foundation. I expect it should be within RxSwift, not RxCocoa.
But why NotificationCenter+Rx is in RxCocoa? Any reason behind that?
In some of our project, we only use RxSwift without RxCocoa. If we use…

Jake Lin
- 11,146
- 6
- 29
- 40
1
vote
1 answer
Testing UITableView.rx.itemSelected callback in RxSwift
I have a tableView bound to instance var myStrings: BehaviorRelay<[String]>, such that the label of each cell in the tableView is set to the value of each string in myStrings:
myStrings.bind(to: tableView.rx.items(cellIdentifier: cellReuseId,…

kid_x
- 1,415
- 1
- 11
- 31
1
vote
1 answer
How to implement refresh token in ios
only some api call needs the token. and when 401 occurs refresh token call will be taken place.and for each call the token is refreshing. how to execute more than 1 api synchronously when 401 occurs

Renjish C
- 49
- 6
1
vote
2 answers
How to test the UI Binding between RxSwift Variable and RxCocoa Observable?
I have a simple ViewModel with one property:
class ViewModel {
var name = Variable("")
}
And I'm binding it to its UITextField in my ViewController:
class ViewController : UIViewController {
var viewModel : ViewModel!
…

Rici
- 1,014
- 2
- 12
- 21
1
vote
1 answer
Subscribing to Observable or Driver takes too long in RxSwift
I noticed that RxSwift slows down the app, I don't know if this is my fault or the framework.
I have binding inside custom class of UICollectionViewCell, which is fired for configuring cell. For example this part of…

Nominalista
- 4,632
- 11
- 43
- 102