Skip to content

Instantly share code, notes, and snippets.

@tonyarnold
Last active December 17, 2015 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyarnold/5631849 to your computer and use it in GitHub Desktop.
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
//
// 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