Last active
December 17, 2015 15:29
-
-
Save tonyarnold/5631849 to your computer and use it in GitHub Desktop.
Use this to simplify your signals that need to be delivered on the main thread
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RACSignal+DeliverOnMainThread.h | |
// | |
// Created by Tony Arnold on 3/05/13. | |
// Copyright (c) 2013 The CocoaBots. All rights reserved. | |
// | |
#import <ReactiveCocoa/ReactiveCocoa.h> | |
@interface RACSignal (DeliverOnMainThread) | |
- (RACSignal *)deliverOnMainThread; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RACSignal+DeliverOnMainThread.m | |
// | |
// Created by Tony Arnold on 3/05/13. | |
// Copyright (c) 2013 The CocoaBots. All rights reserved. | |
// | |
#import "RACSignal+DeliverOnMainThread.h" | |
@implementation RACSignal (DeliverOnMainThread) | |
- (RACSignal *)deliverOnMainThread | |
{ | |
return [self deliverOn:[RACScheduler mainThreadScheduler]]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment