Questions tagged [rx-cocoa]

238 questions
0
votes
2 answers

Search a value in Array of Observable

I'm having array of Bool Observables in Rxswift. let rxBoolObservableArray: [Observable] = [Observable]() Now, How to get If any of the element is false?
mohsin
  • 530
  • 5
  • 24
0
votes
1 answer

Implementing `DelegateProxy` (RxSwift/RxCocoa) when delegate field is not called `delegate`

I need some help with DelegateProxy implementation. Specifically, what is the proper way of implementing it when the delegate field has different name than simply delegate? Such as in SKPhysicsContactDelegate it is called contactDelegate. I tried…
Maxim Volgin
  • 3,957
  • 1
  • 23
  • 38
0
votes
1 answer

Why withLatestFrom don't return latest value?

I use some BehaviourRelay for some variable. And I use withLatestFrom for one of them. But withLatestFrom didn't return the latest value I bind to it. If I use combineLatest. It works but I want to know why the code with withLatestFrom not work let…
Hoangtaiki
  • 41
  • 3
  • 5
0
votes
1 answer

Async task and multiple observers with RxSwift

I have one problem and don't know, how to fix this. In my ViewModel I have got Observable field with value. self.diseaseDetails = Observable.create { (observer) -> Disposable in _ = SAPI.get().diseases(diseases: 5, success: {…
Unmerciful
  • 1,325
  • 4
  • 21
  • 38
0
votes
2 answers

RxCocoa-observable is emitting new data from API but tableview.rx.items doesn't show new data

I am new to both RxSwift and RxCocoa. I have a working REST service on local which returns a Movie object for given "id". On my storyboard there is a tableView (UITableView) which has custom cells (MovieCell). Each movie cell has a UILabel named…
0
votes
1 answer

RxSwift Custom DataType Convertion without Binders

Im new to RxSwift and working on with one of the application. I had come across an issue where in my viewModel i get a custom DriverType(because of my algorithms or function calls which i needed in my case), say : Driver. Now i…
Mahesh S
  • 309
  • 1
  • 11
0
votes
1 answer

RxSwift Driver weakly subscription?

I was looking for an easier way to pass function as parameter into Observable's subscribe method without causing retain cycle; I don't want to always have to use [weak self] every single time. I've just come across this answer, and it's exactly what…
Davuth
  • 555
  • 3
  • 9
  • 16
0
votes
1 answer

Is there a way yo bind preferredStatusBarStyle with RxCocoa?

I was using following code bind statusBarStyle. public extension Reactive where Base: UIApplication { public var statusBarStyle: Binder { return Binder(self.base) { view, attr in view.statusBarStyle = attr …
Meanteacher
  • 2,031
  • 3
  • 17
  • 48
0
votes
1 answer

Switch button on tableview cell Rxswift

I'm trying to add a switch change state action to each tableview cell on my tableview, The problem is that the first time I run the application the state action gets called for each cell created. Has an example when I initially have 5 items on the…
Bruno
  • 1,032
  • 1
  • 16
  • 40
0
votes
1 answer

RxCocoa map optional error in Swift4 with 'Cannot convert value of type 'String?'

In working through the tutorial at https://www.raywenderlich.com/138547/getting-started-with-rxswift-and-rxcocoa using Xcode 9.3 and Swift4 There is the code: private func setupTextChangeHandling() { let creditCardValid =…
chadbag
  • 1,837
  • 2
  • 20
  • 34
0
votes
1 answer

Observable subscribe alway once issue

I writing async unit tests for RxSwift,this my code,I can't understand subscribe only once class TestViewModel: NSObject { let result : Observable init(input:Observable) { result = input.flatMapLatest({ (value) ->…
Karim
  • 322
  • 4
  • 20
0
votes
3 answers

Validate all textfield on button click using RxSwift and RXCocoa

I am new to RxSwift and RxCocoa and I'm learning it. I want to validate all textfield on button click and based on the validation I need to show alert message to user. After validation is successful I need to insert record in table. Refer the…
Mahendra
  • 8,448
  • 3
  • 33
  • 56
0
votes
2 answers

RxAlamofire cancel network request

Below is the example code of RxAlamofire network request. My problem is that I want to cancel this request whenever the View Controller is dismissed. I tried to assign this request to a global variable but requestJSON method returns…
Burak Akyalçın
  • 302
  • 5
  • 26
0
votes
1 answer

RxSwift Cannot convert call result type '(_) -> Disposable' to expected type '(_) ->

I'm trying to add an headerView to a collectionView using RxSwift. I get this error: Cannot convert call result type '() -> Disposable' to expected type '() -> at this line: obsHeader.asObservable().bind(to: collectionView.rx.items(dataSource:…
0
votes
1 answer

RxSwift, How to draw tableView without using RxDataSourced?

I can't figure out how to do your dataSource. I watched lessons on RxSwift and RxCocoa and realized that for complex tables you need to use your datasource. Found a library RxDataSourced but we're not allowed to use it. Decided to write your own…