Questions tagged [rx-cocoa]
238 questions
0
votes
1 answer
RxSwift Variable (Behavior Subject) does not emit signals
I have a simple ViewModel:
struct ViewModel {
var someText = Variable("")
func foo() -> Observable {
return someText.asObservable()
}
}
In the ViewController, viewModel is the instance variable, and…

Kevin Le - Khnle
- 10,579
- 11
- 54
- 80
0
votes
1 answer
How to observe Variable<[Game]> from another Variable<[Team]>?
How can observe a Variable<[Game]> from an array of teams (Variable<[Team]>) so that every time a Game comes up (Variable<[Game]> changes since the games array is modified), the array of Team should be updated accordingly, such as assigning points,…

rgoncalv
- 5,825
- 6
- 34
- 61
0
votes
1 answer
How to using RxSwift to cancel the previous request
I have a getting API request function.
I also have a searchBar to search server Data.
And I want to cancel the previous request when user input every characters.
I search the keywords "flatMapLatest".
But I don't know how to using "flatMapLatest" to…

Beginnerrrrrr
- 537
- 1
- 8
- 27
0
votes
1 answer
RxSwift - Two-way binding to use the same screen to edit and add model
I can bind a UITextField.rx.text to a Variable. This works fine when I'm into a "creating" screen. But, supposing I have a already created model and want to edit it on the same screen, how would I do that?
I've also seen a lot about infix…

llanfair
- 1,845
- 4
- 27
- 43
0
votes
2 answers
RxSwift UITableView binding when also using a UISearchController
In my view controller I have a UISearchController associated with the UITableView. So all my normal table view datasource methods do the old
if isSearching {
// use filteredTableData array
} else {
// use SharedModel.shared.participants…

Gargoyle
- 9,590
- 16
- 80
- 145
0
votes
0 answers
UITextField no longer has the function distinctUntilChanged()
Since upgrading to Swift 3 with pod 'RxSwift', '~> 3.0' and 'RxCocoa', '~> 3.0', it seems that distinctUntilChanged() is no longer available for UITextField. I want to use it as below. Do I need to write and extension for UITextField or am I missing…

Alan
- 796
- 9
- 26
0
votes
2 answers
How to subscribe to PublishRelay from generic observable?
Kotlin Code:
fun Observable.circuitBreaker(): Observable {
val relay = PublishRelay.create()
this.subscribe(relay)
return relay.toFlowable(BackpressureStrategy.LATEST).toObservable()
}
Above is a Kotlin code which I'm trying to…

Dinesh Raja
- 8,501
- 5
- 42
- 81
0
votes
1 answer
Add a spinner on making a moya request using RxSwift and mvvm and dismiss it when user receives a response
I have an app where I am trying to implement RxSwift using MVVM.
I have the SignInViewModel where I am doing the validation and I am updating the login observable with the rest response boolean that I am listening to .
In the controller class when…

A.S
- 798
- 1
- 10
- 32
0
votes
1 answer
Merge Observables of UIBarButtonItem tap and UIView tapGesture()
I have two sources for the same action. A regular RxCocoa tap in a UIBarButtonItem:
browseButton.rx.tap
and a RxGesture tap gesture recognizer in a UIView:
notConnectedView.rx.tapGesture().when(.recognized)
I subscribe to it the usual…

emenegro
- 6,901
- 10
- 45
- 68
0
votes
1 answer
Difference between two approaches to query
I've got a problem with RxSwift Scheduler:
Whats the difference between this two codes:
let results = query.flatMapLatest { query in
return search(query)
}
.observeOn(MainScheduler.instance)
and
let results = query.flatMapLatest { query in
…

NVXA
- 11
- 2
0
votes
2 answers
how i can change title with RX index
I want to change title with an observable int.
in view Model
var index = Variable(0)
in view Controller
let title = ["title1","title2","title3","title4","title5"]
override func viewWillAppear(_ animated: Bool) {
self.viewModel.index.value = 0
…

user3333632
- 51
- 1
- 4
0
votes
1 answer
RxCocoa data binding causes collection view to scroll to top
I have an iOS app that I am rewriting to use RxSwift and RxCocoa. It works really well, but I have problems with collection view data bindings.
In my app, I perform data bindings when viewWillAppear is called on a view controller, for instance:
let…

Daniel Saidi
- 6,079
- 4
- 27
- 29
0
votes
1 answer
What is the syntax for binding a function to a toggle button?
The following is a snippet of tutorial code that binds a toggle switch to an activity indicator:
aSwitch.rx.value
.map { !$0 }
.bind(to: activityIndicator.rx.isHidden)
.disposed(by: disposeBag)
aSwitch.rx.value.asDriver()
…

Frederick C. Lee
- 9,019
- 17
- 64
- 105
0
votes
1 answer
CocoaPods RxCocoa 3.6.1 build failed in Xcode 9
RxCocoa version 3.6.1 fails to build in Xcode 9 with error message :
Initializer 'init(parentObject:)' with Objective-C selector 'initWithParentObject:' conflicts with initializer 'init(parentObject:)' from superclass 'RxScrollViewDelegateProxy'…

Martin S
- 378
- 2
- 10
0
votes
1 answer
Reload UITableView row after downloading image (using MVVM)
In application I am writing I decided to use MVVM patter. I am binding ViewModels with Views using RxSwift + RxCocoa. Now I am facing a problem I cannot find any solution myself.
I have a list of ViewModels which I want to display in UITableView. In…

Tiero
- 107
- 11