Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Use this to simplify your signals that need to be delivered on the main thread
//
// 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
//
// 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