Questions tagged [reactive-cocoa]

ReactiveCocoa (RAC) is a Swift framework inspired by Functional Reactive Programming. It provides APIs for composing and transforming streams of values.

ReactiveCocoa (RAC) is a Swift framework inspired by Functional Reactive Programming. It provides APIs for composing and transforming streams of values.

860 questions
10
votes
2 answers

How to conditionally buffer RACSignal values?

I'm working on some code that interacts with a remote API via websockets. My data layer is responsible for establishing and monitoring the websocket connection. It also contains methods that can be used by the application to enqueue websocket…
10
votes
2 answers

ReactiveCocoa sequencing with async network requests

I'm building a demonstration app and am trying to conform to the ReactiveCocoa design pattern as much as possible. Here's what the app does: Find the device's location Whenever the location key changes, fetch: Current weather Hourly…
10
votes
2 answers

How would you write fetching a collection the "Reactive Cocoa" way?

The client I'm building is using Reactive Cocoa with Octokit and so far it has been going very well. However now I'm at a point where I want to fetch a collection of repositories and am having trouble wrapping my head around doing this the "RAC…
rnystrom
  • 1,906
  • 2
  • 21
  • 47
9
votes
3 answers

How to write height for row in RxSwift?

I want to convert the below code into RxSwift. And also please help me how to write button Action code in RxSwift. ReactiveCocoa or RxSwift Which one is better to use in swift3? func tableView(_ tableView: UITableView, numberOfRowsInSection section:…
Bharath
  • 125
  • 1
  • 1
  • 7
9
votes
1 answer

Enum case switch not found in type

Can someone please help me with this. I have the following public enum public enum OfferViewRow { case Candidates case Expiration case Description case Timing case Money case Payment } And the following…
Steaphann
  • 2,797
  • 6
  • 50
  • 109
9
votes
4 answers

RxJava (or Rx.NET) equivalent of ReactiveCocoa's RACObserve

Given an arbitrary field on a Java object, I want to create an Observable that will watch that field and push a new result to an Observer every time the value of the field changes. ReactiveCocoa has a macro called RACObserve, which appears to do…
9
votes
1 answer

Chaining asynchronous operations from an array of objects with ReactiveCocoa

I have an array of entities and I want to perform asynchronous operations on the entities. The operations should be chained and run in the same order with the entities in the array. I'm new to RAC. How to do that in RAC?
Arnol
  • 2,107
  • 2
  • 17
  • 19
9
votes
1 answer

Testing RACCommand on View Model

I'm trying to test the result of a RACCommand executing on my view model. I set my submit command up like so: - (void) createSubmitCommand { @weakify(self); self.submitCommand = [RACCommand commandWithCanExecuteSignal: [self validSignal]]; …
JFoulkes
  • 2,429
  • 1
  • 21
  • 24
9
votes
1 answer

How do I get the "old value" from a ReactiveCocoa signal?

If I'm using RACable like this: [RACAbleWithStart(self.myProp) subscribeNext:^(id x) { // Do stuff }]; How can can I access the old value of myProp (before the change the caused the signal to fire)? So I can access it like…
8
votes
2 answers

Error with latest ReactiveCocoa Carthage : No such module 'Result'

I'm updating my project to Swift 5 Xcode 10.3. Everything was working fine with the previous Swift version now with the latest ReactiveCocoa 10.0.0 Already tried : Deleting and updating all carthage Deleting derivedData Folder, clean and build
8
votes
3 answers

How to obtain a UIAlertController observable (ReactiveCocoa or RxSwift)?

I implemented a "reactive" UIAlertController so I can get an Observable of the button press. (See code below). My question, or questions, are: Is this implementation correct? I don't like storing the observers; I wonder if there's a better…
Ferran Maylinch
  • 10,919
  • 16
  • 85
  • 100
8
votes
1 answer

How do I convert a RACSignal to a SignalProducer in ReactiveCocoa 5?

In ReactiveCocoa 4, we could convert a RACSignal into a SignalProducer using toSignalProducer(). This method does not exist in ReactiveCocoa 5, so how can we do the same thing?
Luke
  • 7,110
  • 6
  • 45
  • 74
8
votes
2 answers

ClangFormat style for ReactiveCocoa

I am using ClangFormat. I wish to update the style of my ReactiveCocoa code from this [[self.myService indexCase] subscribeNext:^(id response) { DDLogDebug(@"response : %@", response); } error:^(NSError *error) { …
Ríomhaire
  • 3,084
  • 4
  • 25
  • 40
8
votes
1 answer

Why doesn't SignalProducer return a Signal?

I feel like I understand all of the basic components of ReactiveCocoa (conceptually), by understanding how to connect all of the pieces together is still a bit confusing. For example, after reading about Signal, I fully expected SignalProducer to…
Jason Pepas
  • 424
  • 5
  • 12
8
votes
1 answer

Testing RACSignals with XCTest

I'm using the MVVM paradigm in my current iOS app. Recently, I have also started using ReactiveCocoa with the project. I've now moved onto experimenting with Unit testing as well. The problem I am facing is how to correctly test the custom…
Robert J. Clegg
  • 7,231
  • 9
  • 47
  • 99
1 2
3
57 58