Created
November 19, 2013 08:54
-
-
Save nevyn/7542335 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@implementation MeteorClient (GFTask) | |
- (SPTask*)gf_sendMethod:(NSString*)method parameters:(NSArray*)params | |
{ | |
SPTaskCompletionSource *source = [SPTaskCompletionSource new]; | |
[self sendWithMethodName:method parameters:params responseCallback:^(NSDictionary *response, NSError *error) { | |
if(error) { | |
[source failWithError:error]; | |
} else { | |
[source completeWithValue:response]; | |
} | |
}]; | |
return source.task; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment