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

RxFlow: how to implement deeplink navigation

The app is tab based app using RxFlow for shaping the navigation. From deeplink I have an understanding of what Steps are needed to get to tab 1 and push VCs from there. So, in my naivete knowing close to zero about the RxFlow (or RxSwift for that…
Anton Tropashko
  • 5,486
  • 5
  • 41
  • 66
0
votes
1 answer

RxSwift blockingGet equivalent

I'm developing a quite old application and need to handle between new rx way and old legacy threads. I started using repository pattern where all is emitted in Observables. And now I wanted to use my new repositories in old code. In RxJava it is…
michalp
  • 83
  • 5
0
votes
1 answer

How to use an Enum to send different networkings in RxSwift

I'm a freshman in the RxSwift's world.Here is my circumstance: First of all,I have an Enum defines two states of my business. Then,I have 2 buttons,Tap button A, first I want to change the value of Enum to stateA, then send a request. Tap button B…
Frank8888
  • 11
  • 2
0
votes
1 answer

RxSwift Subjects to update UI

I have an app that uses the delegate method to communicate controllers with ViewModels. But I would like to start using reactive programming with RxSwift. The problem I have is that I don't know what subject to use. The first thing I need is an…
0
votes
0 answers

Reorder the content of BehaviourRelay without emitting

I have a situation at hand. I have a designerDress:BehaviourRelay<[MyCustomObjects]> Already implemented in code which drives few UI components. Now I have a requirement to reorder the array which is simple let tempArray =…
amar
  • 4,285
  • 8
  • 40
  • 52
0
votes
1 answer

How to sort in chronological order in a list of events?

This code uses RxSwift import RxSwift struct Input { let loadTrigger: Observable } protocol UseCase { func getEventsLists() -> Observable<[EventsList]> func saveEventsList(eventsList: EventsList) -> Observable } struct…
Alessandro
  • 31
  • 1
0
votes
1 answer

RxCocoa/RxSwift crash when accessing TableViewDataSourceNotSet tableView(_:cellForRowAt:)

I'm using RxCocoa and RxSwift to render a UITableView against an array provided by a BehaviorRelay. The code to bind the data is below: // MyViewModel: var itemList = BehaviorRelay(value: [MyItem]()) ... func loadData() { var items = [...] //…
Mando
  • 11,414
  • 17
  • 86
  • 167
0
votes
1 answer

Getting Urlsessiontask failed with error: the request timed out with blank screen RxSwift in swift

I am using RxSwift in swift. When my server is close it shows below error with blank screen. I have used a alert. But I have to click too many time to close the alert here is the error I have implemented RxSwift below like Data Model struct…
Enamul Haque
  • 4,789
  • 1
  • 37
  • 50
0
votes
1 answer

Can you avoid closure memory leaks by using functions instead?

So I'm using RxSwift and has a function that looks like this: private func setAndVerifyTestmode(isOn: Bool) { parameterService.setTestMode(value: isOn) .flatMap { _ in self.parameterService.requestTestMode() } .subscribe( { [weak…
Joakim Sjöstedt
  • 824
  • 2
  • 9
  • 18
0
votes
1 answer

Hide UIButton after click in RxSwift

I need to hide UIButton just after it clicked using RxSwift. I'm not getting any way to do this. Need help here!
0
votes
1 answer

RXSwift - Waiting multiple API or task to finish

I am new to RxSwift and I would like to achieve something like this. Here's the situation I have 2 different APIs that needs to populate in a UITableView. Therefore I need to combine 2 sets of data I would like to achieve something like waiting 2…
cMoNz
  • 13
  • 3
0
votes
1 answer

Reverse binding to parent view model from child view model

I have a main view model called CustomizeMenuItemViewModel which has a property maxItemCount which needs to be decreased to 0 whenever the user interacts with the view to add one item in the shopping bag. The view interacts with its own view model…
0
votes
0 answers

Making MapBox annotation delegate RX compatible

I need to find the way to make MapBox delegates fully reactive, just like some many native ones. I managed to make MapBox annotations bindable by subscribing PointAnnotationManager to ReactiveCompatible protocol: extension PointAnnotationManager:…
0
votes
1 answer

Why does this NOT leak memory? RxFeedback

class ViewModel { ... func state(with bindings: @escaping (Driver) -> Signal) -> Driver { Driver.system( initialState: .initial, reduce: State.reduce(state:event:), feedback: …
hydro1337x
  • 95
  • 5
0
votes
0 answers

How to make Custom Control Property with respect to get value in iOS Combine?

Here is my code to set up Custom Property in RXSwift for the UIControl but same I am not able to get in Combine although I have taken the CombineCocoa Reference. public class OTPFieldView: UIControl, InputFieldView { public typealias FieldType =…
RakeshDipuna
  • 1,570
  • 13
  • 19