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
0
votes
1 answer

Unpacking an array in Reactive Cocoa

I have a method that looks something like this: - (RACSignal*)savedObjectsOfEntityType:(NSEntityDescription*)entity { return [[[[NSNotificationCenter defaultCenter] rac_addObserverForName:NSManagedObjectContextDidSaveNotification object:nil]…
Mihai Damian
  • 11,193
  • 11
  • 59
  • 81
0
votes
2 answers

ReactiveCocoa limit the update

Possible to somehow limit the update download 0.3 seconds using a ReactiveCocoa? example: if (the_previous_update == indefinitely) { update; } if else (current_time - the_previous_update>=0.3) { the_previous_update = current_time; update; } else{ do…
Kostya
  • 21
0
votes
1 answer

What is a correct alternative for subscribing to signals in ReactiveCocoa for network calls?

I'm new to ReactiveCocoa world and after reading best practices of ReactiveCocoa here I knew that I need to "avoid explicit subscriptions and disposal" but in all tutorials about network and ReactiveCocoa I saw the same pattern : create signal (make…
MainstreamDeveloper00
  • 8,436
  • 15
  • 56
  • 102
0
votes
1 answer

ReactiveCocoa observe two property

I need to check two values and set conditions based on these two values, return a NS_ENUM value. From ReactiveCocoa github readme, I find this RAC(self, createEnabled) = [RACSignal combineLatest:@[ RACObserve(self, password), RACObserve(self,…
xialin
  • 7,686
  • 9
  • 35
  • 66
0
votes
0 answers

Restart network RACSignal chain on search text change

I have a semi-working approach to this problem. I have a search field that sets off a series of dependent cold RACSignals - in my case network requests (similar to Chaining dependent signals in ReactiveCocoa). If at any point during those network…
chasew
  • 8,438
  • 7
  • 41
  • 48
0
votes
2 answers

Using ReactiveCocoa to Respond to User Input

I'm trying to use ReactiveCocoa to control binding and validation on a text field in my app. When I subscribe to a signal, it immediately does the binding from the text field to the model and runs the validation. Normally that wouldn't be an issue,…
pbuchheit
  • 1,371
  • 1
  • 20
  • 47
0
votes
1 answer

Integrating Reachability with ReactiveCocoa?

I'm working on the development of an app using ReactiveCocoa and the time has came to integrate Reachability to handle Network Events. I'm not sure about the work I've done as some of RAC design guidelines advice against it. But from what I've been…
0
votes
1 answer

How to use RACMulticastConnection for app components notification

Short version: Is it possible to use RACMulticastConnection in the same way as NSNotificationCenter? I mean to keep the subscribed blocks valid even for another call [connection connect]? Long version: Among different subscribers I share a reference…
Vladimír Slavík
  • 1,727
  • 1
  • 21
  • 31
0
votes
2 answers

Is there something similar to $scope.$watch for NSMutableArray

I've been struggling for a day to get this working correct. I have NSMutableArray of Items. Sometimes during the application lifecycle, the App will push and pop objects in there. I can usually do this on the AngularJS side with $scope.$watch. I've…
Max Alexander
  • 5,471
  • 6
  • 38
  • 52
0
votes
1 answer

ReactiveCocoa: dispose receiver of replayLazily

I'm using ReactiveCocoa to compose complex signal of the following structure: RACSignal* data1FromNetwork = ...; RACSignal* data1FromNetworkHub = [data1FromNetwork replayLazily]; RACSignal* derivedData = [data1FromNetworkHub…
kjam
  • 809
  • 1
  • 7
  • 17
0
votes
2 answers

DataSource methods with RACSignals

Can I implement dataSource method with RACSignal that returns value. I wan't something like this - [self rac_signalForSelector:@selector(tableView:numberOfRowsInSection:)]{ return @10;}]; How to deal with methods that needs a return values…
Kostiantyn Koval
  • 8,407
  • 1
  • 45
  • 58
0
votes
1 answer

How to use ReactiveCocoa for UITextViewDelegate

I want to make my UITextView to be not editable when the length of text is more than 200. When using UITextViewDelegate, I can use - (BOOL)textViewShouldBeginEditing:(UITextView *)textView. How to make it using ReactiveCocoa?
Andrew
  • 1,088
  • 10
  • 21
0
votes
1 answer

NSUserDefaults and RACChannelTo

As descriped in the documentation I tried to bind some properties to the NSUserDefaults. Now I'm getting a EXC_BAD_ACCESS (code=2, address=0x10)) exception. What is wrong with the code? @interface Settings:NSObject @property (copy, nonatomic)…
melbic
  • 11,988
  • 5
  • 33
  • 37
0
votes
1 answer

Reactive Cocoa and multiple AFNetworking requests in short period of time

I'm struggeling with the way I handle multiple requests to a web service with AFNetworking and Reactive Cocoa. In this scenario the user is asking the API to deliver a bunch of suggestions for a character/integer search input to pick a city out of a…
MrBr
  • 1,884
  • 2
  • 24
  • 38
0
votes
1 answer

ReactiveCocoa finally never be called with already completed replaySubject. Is it expected behavior?

Is this expected behavior? RACSubject *subject = [RACReplaySubject replaySubjectWithCapacity:1]; [subject sendCompleted]; [subject finally:^{ NSLog(@"never called"); }]; [subject subscribeCompleted:^{ NSLog(@"called"); }]; If so, how do I…
hiroshi
  • 6,871
  • 3
  • 46
  • 59