Questions tagged [reactive-cocoa-4]

The fourth version of RAC. ReactiveCocoa (RAC) is a Cocoa framework inspired by Functional Reactive Programming. It provides APIs for composing and transforming streams of values over time.

48 questions
0
votes
2 answers

ReactiveCocoa SignalProducer Explanation

Because of the behavior of start(), different Signals created from the producer may see a different version of Events. The Events may arrive in a different order between Signals, or the stream might be completely different! Any example to…
Swift Hipster
  • 1,604
  • 3
  • 16
  • 24
0
votes
1 answer

Swift 2 RAC4 Merge UITextField Signal and UISwitch Signal

I've written a reactive-imperative version of the code: widthTextField.rac_textSignal().subscribeNext { (val) in let multiplier = 0.2 if var v = Double(val as! String){ if(self.viewModel.proportionalBool.value){ v *=…
Galfaroth
  • 33
  • 7
0
votes
1 answer

Transform signal of elements into arrays with size using ReactiveCocoa

I'm trying to find a way to transform a signal that sends X element into arrays of X elements limited by size. Something like: signal.take(2).collect().observeNext{changes in myFunction(changes) } But that dies after completed. I need it to…
David Collado
  • 358
  • 3
  • 10
0
votes
0 answers

How to dispatch two RAC SignalProcedures one after another?

I have a two SignalProducers making networks calls, one makes a regular server data request while the other checks if the current user token is still active and, in case it isn't, makes a refresh_token request. The point is to make the token…
Ces
  • 343
  • 3
  • 13
0
votes
1 answer

ReactiveCocoa Ambiguous reference to member RACSignal

I'm trying to return an RACSignal that I can use in my objective-c code, I've tried various ways. EX: @objc class func getPosts() -> RACSignal { let (signal, observer) = Signal.pipe() return signal.toRACSignal() …
0
votes
1 answer

ReactiveCocoa 4: Observing an Action's completed event

I'm observing a reactive cocoa 4 action, so I can run some code when the action is executed. Here's my action's defintion: buttonAction = Action() { value in return SignalProducer { observer, _ in …
theprole
  • 2,274
  • 23
  • 25
0
votes
1 answer

Lazy `SignalProducer` that fetches more data asynchronously when all data has been consumed

Let's imagine that we can fetch a fixed number of messages asynchronously (one request, containing N elements) func fetchMessages(max: UInt, from: Offset) -> SignalProducer Now, I'd like to turn this into an unbounded…
Sami Dalouche
  • 654
  • 7
  • 15
0
votes
1 answer

ReactiveCocoa 4 - Need help on validate input upon button tap

I'm new to ReactiveCocoa, and I'm trying to figure out the syntax for validating form input upon button tap. There are quite a number of sample code for validTextSignal, but most of them either hooked into Action-enableIf, or handle UI bindings…
0
votes
2 answers

Reactive Cocoa `then` operator

I couldn't find much documentation about RAC then operator. What is the purpose it serves. When should I use. it? Can someone explain in below context? [[[[self requestAccessToTwitterSignal] then:^RACSignal *{ @strongify(self) return…
Swift Hipster
  • 1,604
  • 3
  • 16
  • 24
0
votes
2 answers

Difference in combineLatest behaviour Signal v SignalProducer (ReactiveCocoa 4)

I'm running through basic operators at the moment and ran into a difference in the behaviour of the combineLatest operator. I'm not sure if this is a bug or my failure to understand the variation between Signals and SignalProducers. let (numbersSig,…
rustproofFish
  • 931
  • 10
  • 32
0
votes
1 answer

UIWebView binding using ReactiveCocoa 4

I'm trying my first project using reactive cocoa 4. In ViewModel I have var title = MutableProperty("") and in ViewController is binding self.articleDetailView.titleLabel.rac_text <~ self.articleViewModel.title I'm using for binding…
marysmech
  • 183
  • 1
  • 3
  • 10
0
votes
2 answers

ReactiveCocoa 4 set up enabled/disabled Action

I'm using ReactiveCocoa4 to add some basic login functionality to my project. I have set up 'username' and 'password' MutableProperties in my viewModel and bound them to their associated textFields in the viewController. So far so good, but I'm…
user3719120
  • 97
  • 1
  • 7
0
votes
2 answers

Retry after delay if signal doesn't send next in ReactiveCocoa 4

I am using ReactiveCocoa 4.0 with Swift. I have a signal called startedSignal of type Signal that I subscribe to in a view controller. startedSignal.observeNext { _ in // Do stuff } I basically want to wait a number of seconds,…
Reda Lemeden
  • 1,017
  • 1
  • 10
  • 16
0
votes
1 answer

Pipe for repeating network requests in Reactive Cocoa 4

I want to refresh data every 15 seconds from an API using Reactive Cocoa 4. Since more than one subscriber can ask for this data at the same time, I want to have multiple subscribers to share one source of data. My current approach is to have one…
beseder
  • 1,352
  • 2
  • 15
  • 25
0
votes
2 answers

RACObserve in RAC 4

I am woking on a new new swift 2 project using ReactiveCocoa4 and I am wondering how to observe a property change like I dit it before in ObjC. [RACObserve(self,self.model.wifiState) subscribeNext:^(id newValue){ @strongify(self); …
thierryb
  • 3,660
  • 4
  • 42
  • 58