Questions tagged [rx-swift]

RxSwift's intention is to enable easy composition of asynchronous operations and event/data streams. Use this tag only for questions that are specific to the RxSwift - Reactive Programming paradigm, or those that require code in the language. Use the related tags [ios], [osx], [apple-watch], [cocoa-touch], and [cocoa] for (language-agnostic) questions about the platforms or frameworks.

About Rx and RxSwift

Rx is a generic abstraction of computation expressed through Observable<Element> interface.

RxSwift is a Swift version of Rx.

It tries to port as many concepts from the original version as possible, but some concepts were adapted for more pleasant and performant integration with iOS/macOS environment.

Cross platform documentation can be found on ReactiveX.io.

Like the original Rx, its intention is to enable easy composition of asynchronous operations and event/data streams.

KVO observing, async operations and streams are all unified under abstraction of sequence. This is the reason why Rx is so simple, elegant and powerful.


Resources

2149 questions
0
votes
0 answers

How to bind action or mutation result with any navigation emitter in ReactorKit

I want to merge ReactorKit with RxFlow. Is there an elegant idea how to bind any action or mutation to steps emitter likes PublishRelay inside of Reactor My sample import ReactorKit import RxFlow class ViewModel: Reactor, Stepper { let steps:…
0
votes
1 answer

Handle unrelated serial api calls in RxSwift

I have a requirement to get responses from multiple requests with different models in RxSwift. I want to do this without GCD or Semaphore and only with RxSwift. I try this code but have some problems with in different responses with different models…
0
votes
1 answer

"withLatestFrom" won't accept BehaviorRelay

I've got this simple view model to check a phone number's status before registering a user. But I've got this error: Instance method 'withLatestFrom' requires that 'BehaviorRelay' conform to 'SharedSequenceConvertibleType' Here's the code: import…
0
votes
1 answer

How to reload data and view using rxswift and mvvm pattern

This time, I am implementing the screen with RxSwift / MVVM. It's too difficult to implement RxSwift as an MVVM. What I wanted to ask you was to enter the list screen and get the data. Then it went into the detail screen and changed specific…
Tae Hun Yu
  • 39
  • 7
0
votes
1 answer

RxSwift driver not call when set UITextField text with code

This is my ViewModel core code let isEnable = Observable.combineLatest(input.username, input.password) { u, p in return u?.isEmpty == false && p?.isEmpty == false }.asDriver(onErrorJustReturn: false) Driver…
Nansen
  • 1
  • 1
0
votes
1 answer

Is there any waitUntil operator or something similar in RXSwift to wait a value?

I am using RXSwift to handle with a lot of async AVAssetWriterInput write operations, but I need to wait for isReadyForMoreMediaData before writing more buffers inside the file, how can I handle this? Basically, the observable receives a lot of…
0
votes
0 answers

UIView to UIImage code is not working. It causing an runtime error

I have to convert UIView to UIImage because I want to make a custom marker. Currently, I'm making an app using Naver Map SDK. Here is My Code. let marker = NMFMarker() marker.position = NMGLatLng(lat: lat, lng: lng) let windowView =…
장서영
  • 37
  • 4
0
votes
1 answer

Error libsystem_platform.dylib`_os_unfair_lock_corruption_abort during saving data with Core Data on iOS with Swift

I'm new to iOS development. I'm using Core Data for saving data in my iOS app. My app is accessing sharing object from App Delegate in multiple View Controllers and is reading and saving data with Core Data via this object. I'm also using RxSwift…
Piotr Wittchen
  • 3,853
  • 4
  • 26
  • 39
0
votes
1 answer

Why are not my subscriptions not disposed even though disposebag is hooked and my view is dismissed?

I recently noticed that none of my subscriptions are actually disposed even though I hook .disposed(by: disposeBag). Even if I leave the view or dismiss the modal completely, the subscriptions refuse to dispose. I have my views in a tabBar which…
Joakim Sjöstedt
  • 824
  • 2
  • 9
  • 18
0
votes
1 answer

How to use mutiple Models in MVVM

So far, I have been binding the post data from the existing view model. I need to do additional UI work on the table view cell using domain user data. Then, by creating a ViewModel for user data, do I need to have two ViewModels? Or do I have to…
Seul
  • 47
  • 3
0
votes
1 answer

Filter Operator API response not working in RxSwift

I am not able to find out the what is the issue , just to filter out response based on status code as follow: The code should be filter out the response based on the status code & return response & data as observable.
Nick Patel
  • 41
  • 1
  • 6
0
votes
0 answers

RxSwift TableView doesn't see TableViewCell

I am implementing tableview using rxswift. But the tableviewcell is not created. Below is my tableview code. ViewController let customTableView: UITableView = { let tableView = UITableView() tableView.register(CustomCell.self,…
MojitoBar
  • 13
  • 3
0
votes
1 answer

How do I bind an Rx Bool to selectedSegmentIndex of a SegmentedController?

I have an rx observable returning a Bool that I need to bind to a SegmentedControl's selectedSegmentIndex. The function looks like this: func getLockPower() -> Observable { do { return try doorModeService.getDoorLockPower().map {…
Joakim Sjöstedt
  • 824
  • 2
  • 9
  • 18
0
votes
0 answers

Is there an rx framework for bluetooth classic?

I set up my project to use rx-bluetooth-kit to scan for peripherals. In my subscription I received alot of peripherals but for some obscure reason, I coudn't find the actual peripheral that I wanted to connect to. Then it hit me that the peripheral…
Joakim Sjöstedt
  • 824
  • 2
  • 9
  • 18
0
votes
1 answer

Is there any situation where I have to use the Public Subject instead of the Public Relay?

When fetching data, most people use PublishSubject, but what happens when they use PublishRelay? If an error occurs in the PublishSubject while using the app, isn't it dangerous because the app dies?
Seul
  • 47
  • 3