reactive-cocoa

Prefix.pch ReactiveCocoa/RACEXTScope.h file not found error

吃可爱长大的小学妹 提交于 2020-01-15 09:20:11
问题 As mentioned in the title, I have ReactiveCocoa/RACEXTScope.h file not found error in Prefix.pch file. The following is Pod file platform :ios, "7.1" pod 'Parse-iOS-SDK', '~> 1.2' pod 'ReactiveCocoa', '~> 2.3' pod 'ReactiveViewModel', '~> 0.2' pod 'Parse-RACExtensions', '~> 0.0' pod 'CKCalendar', '~> 1.0' pod 'SDWebImage', '~> 3.6' As you can see from images, the file exists. But there is not interface declaration in the file. Does that matter? I'm using Xcode 6.0.1 Can anyone give me a

ReactiveCocoa 4: How to send error to an observer without interrupting the signal

坚强是说给别人听的谎言 提交于 2020-01-04 05:23:50
问题 let (signal, sink) = Signal<[CLBeacon], BeaconManagerError>.pipe() When I call this because the user disabled the Bluetooth: sendError(self.sink, error) the Signal is interrupted and I don't receive more next nor interrupted events after enabling the Bluetooth back again. The Signal is broken. How can I send error types to the observer without interrupting / breaking the Signal ? I can't find in the RAC 4 documentation. Thanks! 回答1: By design, an error causes the signal to finish. The

Enum case switch not found in type

邮差的信 提交于 2020-01-02 01:21:06
问题 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 mutableProperty: private let rows = MutableProperty<[OfferViewRow]>([OfferViewRow]()) In my init file I use some reactiveCocoa to set my MutableProperty: rows <~ application.producer .map { response in if response?.application.status == .Applied { return [.Candidates, .Description, .Timing,

Why the signal is called twice in ReactiveCocoa?

跟風遠走 提交于 2020-01-01 03:20:08
问题 I'm implementing my first code with https://github.com/ReactiveCocoa/ReactiveCocoa. Is for login a user. The line [subscriber sendNext:user]; is called twice, but I expect to be only one. And the map is not called at all (so autologin is never called) This is my implementation: -(RACSignal *) login:(NSString *)email pwd:(NSString *)pwd { DDLogInfo(@"Login user %@", email); RACSignal *login = [RACSignal createSignal:^ RACDisposable *(id<RACSubscriber> subscriber) { [PFUser

Getting “use of undeclared type 'NoError'” with ReactiveCocoa

筅森魡賤 提交于 2020-01-01 02:39:11
问题 I am trying to learn ReactiveCocoa and have a hard time getting started. I keep hitting minor bumps as API and tutorials seems to be outdated quickly. Maybe I have the wrong impression. Just trying to follow this I do not seem to have NoError . It should be imported correctly, since I have access to Signal , rac_textSignal etc. but I don't know why NoError is not available. Their documentation mentions NoError as well but that leads to a 404. This transition to RAC4 mentions NoError as well.

How to use Reactive Cocoa with notifications

一笑奈何 提交于 2019-12-31 09:01:14
问题 How can I create a signal out of a notification name? For example, I want to go from: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidChange:) name:kTTCurrentUserLoggedOffNotification object:nil]; to something like: [signalForName(kTTCurrentUserLoggedOffNotification) subscribeNext:^(id x){ ... }]; 回答1: -[NSNotificationCenter rac_addObserverForName:object:] returns an infinite signal. You can subscribe to it like this Objective-c [[[[NSNotificationCenter

What are the reference ownership semantics of ReactiveCocoa?

≡放荡痞女 提交于 2019-12-31 08:14:52
问题 When I create a signal and bring it into the scope of a function, its effective retain count is 0 per Cocoa conventions: RACSignal *signal = [self createSignal]; When I subscribe to the signal, it retains the subscriber and returns a disposable which, per Cocoa conventions, also has a retain count of zero. RACDisposable *disposable = [signal subscribeCompleted:^ { doSomethingPossiblyInvolving(self); }]; Most of the time, the subscriber will close over and reference self or its ivars or some

Reactive Cocoa / Reactive Swift - Swift 3.0 missing methods

我只是一个虾纸丫 提交于 2019-12-24 01:44:40
问题 Since I updated Reactive Cocoa (RAC 5) for Swift 3.0 which needs Reactive Swift to works, I don't find events methods like textField.rac_textSignal on a UITextField for example, or cell.rac_prepareForReuseSignal for a UICollectionViewCell . I imported both frameworks, I think the problem is that they updated the frameworks and they changed the name of the methods. But I didn't find an updated documentation for Swift 3.0 . I install Reactive Cocoa / Reactive Swift as a submodule in my project,

RACObserve for value update in NSMutableArray?

╄→尐↘猪︶ㄣ 提交于 2019-12-23 02:25:15
问题 I'm having a problem reacting to a value change in NSMutableArray. I have the following (somewhat simplified) code to detect a change: [[RACObserve(self, postedImagesIds) filter:^BOOL(NSMutableArray * postedImagesIds) { return [postedImagesIds count] > 0; }] subscribeNext:^(NSMutableArray * postedImagesIds) { [self uploadFields:fields]; }]; The idea here is to call uploadFields when there is a change in NSMutableArray postedImagesIds . But not only when a new element is added, but also when a

ReactiveCocoa combine SignalProducers into one

半世苍凉 提交于 2019-12-21 11:57:04
问题 I'm using ReactiveCocoa and I have several SignalProducers let center = NSNotificationCenter.defaultCenter() let signalProducer1 = center.rac_notification(name: notificationName1, object: nil) let signalProducer2 = center.rac_notification(name: notificationName2, object: nil) let signalProducer3 = center.rac_notification(name: notificationName3, object: nil) I want to combine them into a single signal producer that produces a signal whenever one of them produces a signal. At first the