Questions tagged [rx-cocoa]

238 questions
2
votes
1 answer

RxSwift Error: Property 'text' requires that 'UITextField' inherit from 'UILabel'

func bindSearchTextField() { searchTextField.rx.text.asObservable().skip(3) .debounce(0.3, scheduler: MainScheduler.instance) .subscribe(onNext: { [weak self] searchText in guard let strongSelf = self…
2
votes
1 answer

Subscribe to a variable of a custom UIView

I have a custom View, and in this custom View I declared var isSelected: false that is gonna be toggle when taping on the view. After I add two of those custom Views in my ViewController. What I need is: When I select one of view, the other one is…
Cublax
  • 1,232
  • 1
  • 11
  • 20
2
votes
1 answer

Get scheduler passed to subscribeOn() while creating Observable/Single

Let me show a simplified example of the problem I'm struggling with: class CarService { func getCars() -> Single<[Car]> { return Single.create { observer in // Here we're using a thread that was defined in subscribeOn(). …
Nominalista
  • 4,632
  • 11
  • 43
  • 102
2
votes
1 answer

How to bind data from viewModel in view with rxSwift and Moya?

I'm trying to create an app to get some news from an API and i'm using Moya, RxSwift and MVVM. This is my ViewModel: import Foundation import RxSwift import RxCocoa public enum NewsListError { case internetError(String) case…
Giuseppe Pennisi
  • 396
  • 3
  • 22
2
votes
2 answers

Different cells CollectionView rxswift

Good evening. Tell me please I need to make such an implementation Have: CollectionView Rxswift The maximum number of cells is 6 If there are less than 6 elements in a certain array, then the first cells are filled with one type (by the number of…
Yurochka
  • 21
  • 1
  • 2
2
votes
1 answer

RxSwift Observable that throws Error alternative to catchErrorJustReturn

I am seeking for alternative way to handle errors thrown through Observable sequence. I have database request that frequently just throws DaoError.notFound (meaning data has not been found). Then I am doing Remote API request that saves new data…
Michał Ziobro
  • 10,759
  • 11
  • 88
  • 143
2
votes
1 answer

Handling 401 status w/ RxSwift & URLSession

I currently have a network client that looks like the below: class Client { let engine: ClientEngineType var session: URLSession init(engine: ClientEngineType = ClientEngine()) { self.engine = engine …
Teddy K
  • 820
  • 1
  • 6
  • 17
2
votes
1 answer

Change format of a textfield on the fly using RxSwift

I want to give my textfield a Currency format so when I type it looks like: $0.00 $0.09 $0.98 $9.87 $98.76
2
votes
1 answer

combining tap event of 3 buttons with rxSwift

I have 3 buttons @IBOutlet weak var editGeomButton: UIButton! // 1 @IBOutlet weak var editDataButton: UIButton! // 2 @IBOutlet weak var deleteDataButton: UIButton! // 3 On click of any of this buttons I want below method to be called. With the…
Anirudha Mahale
  • 2,526
  • 3
  • 37
  • 57
2
votes
1 answer

Fatal error: Binding error to behavior relay: objectDeleted: file #2025

I am facing issue on debug as well as release mode, Xcode 10.2.1 macOS Mojave 10.14 .5 swift5.09 Fatal error: Binding error to behavior relay: objectDeleted: file…
Mukesh Lokare
  • 2,159
  • 26
  • 38
2
votes
1 answer

RxSwift: UISwitch toggle back to initial State

I am looking for solution for a problem I am facing. I have TableView which has multiple cell and each cell has a UISwitch and state of that switch (either on/off) is being set like this: viewModel.permissions …
Shabir jan
  • 2,295
  • 2
  • 23
  • 37
2
votes
1 answer

UICollectionViewDelegate in RxCocoa

I write an extension for UICollectionView which will listen the delegate's shouldHighlightItemAt method,but it don't call. public var shouldHighlightItem: ControlEvent { let source =…
Ruan Kyle
  • 23
  • 3
2
votes
1 answer

Binder in RxSwift which accepts optional Any

I would like to create a Reactive extension to the UIButton which will take any object (value and reference type) and will enable the button based on the value. If it is nil I want to disable the button and enable if it there is value. here is the…
mikro098
  • 2,173
  • 2
  • 32
  • 48
2
votes
2 answers

Using zip operator in RxSwift after creating an array of observables

I have a newBid object, that contains some data and images array. I want to upload all images and data to the server and zip those upload observables. If I create separate drivers for data, image1 and image2, I succeed. But what I want to really do…
Denis Kutlubaev
  • 15,320
  • 6
  • 84
  • 70
2
votes
2 answers

RxSwift: Deliver the first item immediately, debounce following items

I have a textfield to validate, I want to disable a button whenever user is typing. After user stops typing (debounce by 1 second), the validation is carried out and the button is conditionally enabled based on the result. Notice the corner case…
Jack Guo
  • 3,959
  • 8
  • 39
  • 60