Questions tagged [rx-cocoa]

238 questions
0
votes
1 answer

Search Bar Cancel Button with RxSwift

When the cancel button of the search bar is tapped I want to resign the keyboard but the current issue is that my function to handle the cancel button is not working.. You can see my code here: searchBar.rx.cancelButtonClicked …
0
votes
2 answers

Cannot assign to property: 'value' is a get-only property RxSwift -

I want to assign a value to an BehaviorRelay in RxSwift - RxCocoa. But I get this error message: "Cannot assign to property: 'value' is a get-only property". Thats my code: private var todos = BehaviorRelay<[MainToDoData]>(value: []) todos.value…
0
votes
2 answers

How to detect double tap with RxSwift

I'm trying to detect a double tap with RxSwift Without RxSwift I would something like this: private func setupFakePanView() { let singleTapGesture = UITapGestureRecognizer() let doubleTapGesture = UITapGestureRecognizer() …
Tieme
  • 62,602
  • 20
  • 102
  • 156
0
votes
1 answer

RxSwift Delegate Binding isn't Generated?

I am trying to bind a delegate this is what was done /** Delegate Proxy **/ func castOrThrow(_ resultType: T.Type, _ object:Any) throws -> T { guard let returnValue = object as? T else { throw RxCocoaError.castingError(object: object,…
George Host
  • 980
  • 1
  • 12
  • 26
0
votes
0 answers

Not understanding how to implement .drive(onNext: rxcocoa

// View controller call viewModel.bindNotificationReadEvents(readNotificationID: readNotificationIDPublisher.asDriver(onErrorDriveWith: .empty())) …
0
votes
1 answer

RxSwift: Error adding RX bind to UITextField: Value of type 'Binder' has no member 'debounce'

I'm trying to add delay into UITextField but I'm getting the following error: Property 'text' requires that 'UITextField' inherit from 'UILabel' Value of type 'Binder' has no member 'debounce' Here is my implementation: func bind() { …
user2924482
  • 8,380
  • 23
  • 89
  • 173
0
votes
1 answer

Driver is not updation with latest value

I have one filter type enum import RxSwift import RxCocoa enum FilterType { case all case rental case purchased } var currentCategory: Driver = Driver.just(.all) whenever I am updating the currentCategory on segment click.…
0
votes
1 answer

RxSwift - UICollectionView does not update after updating

I have a UITabBarController with 2 controllers. In the first VC user have a list of articles. A user can add some article to favourite (realm database) The second VC it is a list with realm query (favourite article). When 2 controllers created…
0
votes
3 answers

How to check if an observable is empty in RXSwift?

i have initialized an empty observable like this: var subCategories = Observable<[String]>.empty() How can i check if the observable is empty or not? I would like to show a "empty view" to the user if the observable is empty else show the data in…
Frankenxtein
  • 483
  • 7
  • 18
0
votes
1 answer

Convert [Observable] to Observable<[T]> in RxSwift

Here's my implementation. I have favCitiesID = Observable<[Int]> that will be flatMap and map. Each city id will be used in API call that will return Observable. I have reached to the point where I can get [Observable]…
cloudy45man
  • 391
  • 2
  • 19
0
votes
1 answer

Need my server to return a response that includes a data error. Need client to see what was wrong with data in request

As it will become quickly apparent, I have never seriously written a webserver before Here is the current scenario: Clients make requests to webserver, asking to save some data Server looks at payload, and makes 2 checks a. Is this client banned…
A O
  • 5,516
  • 3
  • 33
  • 68
0
votes
1 answer

Disabling a button based on value in a UITextField only works once (RxSwift)

I'm trying to get to grips with RxCocoa and have experienced an unusual bug relating to some dynamic UI behaviour I'm trying to implement. I have a UITextField that's used for user input. The button which adds the input to a Realm database is bound…
rustproofFish
  • 931
  • 10
  • 32
0
votes
2 answers

Observe two sources of data at once

I'm learning RxSwift and RxCocoa. I've run into this problem: I have UITextField and UIPickerView and UIButton. UIButton should become enabled once UITextField is valid. There is different validation regex for each item selected from…
user3554626
  • 425
  • 1
  • 5
  • 9
0
votes
1 answer

RxSwift simple withLatestFrom not firing

I have an observable lazy var user = _user.share(replay: 1) private let _user = PublishRelay() in a UserState.swift singleton. My user observable gets an event as soon as the app loads and I receive a User from the backend. Later on, in one…
Brejuro
  • 3,421
  • 8
  • 34
  • 61
0
votes
1 answer

Best architecture for ViewModels (RxSwift)

I'm wanting to utilise a architectural design that enables me to clearly designate input and outputs in my view model (How To Feed ViewModels) but am curious as to how I can best integrate the "working" part of the view model into this structure. I…
rustproofFish
  • 931
  • 10
  • 32