Questions tagged [reactive-swift]

Anything related to the ReactiveSwift library that brings the reactive programming primitives in Swift

ReactiveSwift is a library that brings the reactive programming approach on Swift. It offers composable, declarative, and flexible primitives that are built around the grand concept of streams of values over time.

This is a pure-Swift implementation of the reactive API. It provides all the nuts and bolts, including Signals, SignalProducers, Properties, Actions and Bindings.

ReactiveSwift documentation

ReactiveSwift project on GitHub

124 questions
0
votes
1 answer

How to combine two Signals with OR

I have two Signals from Notifications. These where fired from an external framework. let successSignal = NotificationCenter.default.reactive.notifications(forName: NSNotification.Name(rawValue: "someNotification")) let failedSignal =…
SWIE
  • 76
  • 4
0
votes
1 answer

How to chain signal producers or sequence of signal producers using reactive cocoa 5 or 6?

I am pretty much noob in ReactiveCocoa/ReactiveSwift. I have two SignalProducers. If first SignalProducer returns nil, then I want to execute second Signal Producer otherwise not. I read the documentation, but I am not sure which syntax helps me to…
0
votes
0 answers

ReactiveCocoa MutableProperty binding creates retain cycle, leaks memory

I have simple one UIViewViewController app with a UILabel outlet. I have one MutableProperty that I bind to label.reactive.text this causes 57 memory leaks. Does binding two mutable properties always leak memory, if so why? class…
stringCode
  • 2,274
  • 1
  • 23
  • 32
0
votes
1 answer

Cyclic Bindings with ReactiveCocoa, How to bind one value to two input UI elements

In an iOS Project, i have to implement a view controller that allows to pick a float value using a slider and a text field at the same time. it should have the following behaviour: whenever a number is typed in the text field, the slider should…
0
votes
1 answer

RACSubject migration to ReactiveCocoa 5 (Swift 3)

I have to migrate an application from ReactiveCocoa 4 to ReactiveCocoa 5 (due to Swift 3 migration) The old implementation uses some RACSubject instances for triggering (performOperationSubject.sendNext) an operation and for handling…
0
votes
1 answer

Reactive Swift Bindings for optional MutableProperty not getting set?

So I have recently started trying to incorporate ReactiveSwift into my project and I can't seem to figure out why this one portion of my code is giving me a compile error when I try to set the property with the <~ operator. So here is what I have so…
0
votes
1 answer

ReactiveCocoa - sequence of signal-producer with general error handling

i have a question about ReactiveCocoa (v5) with Swift 3. In my project I have different services. For example the api or for saving or getting stuff from disk. Those services are returning SignalProducer. I have now something like a sequence of…
Yetispapa
  • 2,174
  • 2
  • 30
  • 52
0
votes
1 answer

How do I merge a Signal and a SignalProducer into a Signal in ReactiveSwift?

How do I merge a Signal and a SignalProducer into a Signal in ReactiveSwift? Below is what I have so far. I can't figure out how to get a Signal on line 3. let (signalA, observerA) = Signal.pipe() let signalProducer = /* some…
0
votes
1 answer

How to handle SignalProducer with ReactiveSwift and Firebase asynchronous method calls?

I am working on an iOS App with Swift 3 using ReactiveSwift 1.1.1, the MVVM + Flow Coordinator pattern and Firebase as a backend. I only recently started to adapt to FRP and I am still trying to figure out how to integrate new functionalities into…
0
votes
1 answer

SignalProducer does not started in my case using ReactiveSwift

Suppose I'd like to read a value from UseDefaults, if it fails, try to ask server for it , I wrote this code, but it will not execute: func getAuthorizationCode() -> SignalProducer { if let authCode =…
Alex Chan
  • 1,116
  • 3
  • 15
  • 33
0
votes
1 answer

ReactiveSwift: Retry up to n times, then execute some code

Consider the code below func test() -> SignalProducer { return SignalProducer { observer, _ in ... } } test() .on(value: { s in print(s) }) .retry(upTo: 2) .start() } Is there a…
Buddy
  • 1,808
  • 3
  • 19
  • 28
0
votes
1 answer

Adding a stream of numbers using ReactiveSwift

New at ReactiveSwift and FRP in general, trying to build a small calculator app to try to get the hang of it and I'm stuck figuring out the reactive way to do something like this. If I have a function that takes a value, how do I pass that value to…
elce
  • 264
  • 4
  • 16
0
votes
0 answers

realm::IncorrectThreadException: Realm accessed from incorrect thread (with ReactiveSwift)

I have a view model that's fetching some data from my API, and when I get data back, I'm setting it both in Realm and on two MutableProperties on the view model userService.getBrowseData().on( failed: { error in …
Zack Shapiro
  • 6,648
  • 17
  • 83
  • 151
0
votes
2 answers

can't generate tableview using rxcoca

I have an app, that shows current weather. Data is downloaded via Alamofire from forecast.io. Result forms a table with forecast. I used simple tableviewdelegate and tableviewDatasource, everything works. But now I wanted to learn some reactive,…
Ruslan Sabirov
  • 440
  • 1
  • 4
  • 19
0
votes
1 answer

Binding UITextView to MutableProperty

How can I bind a UITextView's text property to a MutableProperty, e.g. let property = MutableProperty("") commentTextView.text <~ property This just gives me the error Binary operator '<~' cannot be applied to operands of type 'String!'…
Raphael
  • 2,691
  • 1
  • 16
  • 21
1 2 3
8
9