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

What happens to individual failures with combineLatest?

If i have two SignalProducers (really they are API service requests so they only send 'next' once), and combine them with combineLatest (as i want to dismiss a loading spinner once both finish), what happens if one of them fails? Or both fail? Does…
Chris
  • 39,719
  • 45
  • 189
  • 235
4
votes
1 answer

DynamicProperty vs MutableProperty vs AnyProperty vs ConstantsProperty

What's difference between them? Could you give me an example of in which scenario I should use dynamic/mutable/any/constants property?
4
votes
1 answer

Passing signal from view to model in MVVM with ReactiveCocoa 4

I'm implementing ReactiveCocoa 4 in an as-basic-as-possible iOS app (Swift), in order to get a better idea of how to use it with MVVM architecture. My question is: how do I get a UITextField's textSignal from the view up to the model? What I've got…
Rogare
  • 3,234
  • 3
  • 27
  • 50
4
votes
0 answers

Swift expected type Array<_>

I'm trying to write a UITableView RAC3 Binding helper in swift 2. I'm trying to initialize my binding helper which has a signature init(tableView: UITableView, sourceSignal: SignalProducer<[T], NoError>, reuseIdentifier: String, selectionCommand:…
AndrewSB
  • 951
  • 3
  • 11
  • 25
4
votes
3 answers

RACSignal: Why use rac_textSignal a "defer" to return a RACSignal to self?

The rac_textSignal-Implementation uses "defer" to return a RACSignal on "self". What is the reason for that? This is the implementation: - (RACSignal *)rac_textSignal { @weakify(self); return [[[[[RACSignal defer:^{ …
itinance
  • 11,711
  • 7
  • 58
  • 98
4
votes
0 answers

Rollback in Realm

I'm using Realm in a recent project of mine — and I'm struggling to find an elegant solution to a problem I have. In order to keep the UI responsive, I try to act on most operations instantly. The whole UI is driven off of RLMResults, so in order to…
Mert Dümenci
  • 493
  • 1
  • 5
  • 18
4
votes
1 answer

ReactiveCocoa ignore nil in Swift

I'm using ReactiveCocoa in many places around my app. I've build a check to skip nil values as followed: func subscribeNextAs(nextClosure:(T) -> ()) -> RACDisposable { return self.subscribeNext { (next: AnyObject!) -> () in …
Antoine
  • 23,526
  • 11
  • 88
  • 94
4
votes
1 answer

ReactiveCocoa Issue

I'm attempting to use ReactiveCocoa in my project to handle the population of a UITableView. When I load the data if none is available, I want to set the hidden property of tableView.backgroundView to false. Here's what I have so far: func…
Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
4
votes
1 answer

How to Accomplish this w/ ReactiveCocoa

I'm building a feature where users of my app can find their Facebook friends and add them in the app. There are three steps which I have to do: Get the currently connected users Get the Facebook users Get the Application Users (this is dependent on…
Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
4
votes
2 answers

Proper ReactiveCocoa Chaining

I have created two signal: getConnection and connection.rac_delete(). connection.rac_delete() depends on getConnection completing successfully. What would be the ReactiveCocoa way of doing this? I currently have this solution but it doesn't feel…
Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
4
votes
0 answers

CodeSign Pods trouble

I have a project with 3 targets: 1- DemoApp - iOS App 2- DemoExt - iOS Extension 3- DemoFramework - iOS 8 Framework I'm not sure if my podfile is setup correctly cause I'm having trouble with archiving only. Building each of the targets works…
Edward Ashak
  • 2,411
  • 2
  • 23
  • 38
4
votes
1 answer

What is the difference between RACSequence and RACSignal

Maybe I'm totally missing this but according to the documentation on ReactiveCocoa on their types, RACSequences are signals. However. I see examples where you have code like this: RACSignal *letters = [@"A B C D E F G H I"…
Max Alexander
  • 5,471
  • 6
  • 38
  • 52
4
votes
1 answer

ReactiveCocoa subscribeNext with nil check

Most of the times when I user subscribe next, Ill check if the value isn't nil first, like so: [[RACObserve(self.viewModel, stockViewModel.stock.imageURL) takeUntil:[self takeUntil]] subscribeNext:^(id value) { @strongify(self); //Check…
MCMatan
  • 8,623
  • 6
  • 46
  • 85
4
votes
1 answer

RACObserve bounds or frame of a UIView?

I create a signal to observe the width of a text field's frame in -viewDidLoad: RACSignal *destinationDisplayWidthSignal = [RACObserve(self.destinationNumberTextField, frame) map:^id(NSValue *value) { NSLog(@"rect: %@",…
Xaree Lee
  • 3,188
  • 3
  • 34
  • 55
4
votes
1 answer

Handling next, completed and error in ReactiveCocoa

I am still fairly new in the ReactiveCocoa world and I just wanted to get this common scenario clarified. I noticed that other people are struggling with this matter on GitHub and SO, but I am still missing a proper answer. The following example…
Steffen D. Sommer
  • 2,896
  • 2
  • 24
  • 47