Created
February 10, 2014 12:58
-
-
Save jem-computer/8915456 to your computer and use it in GitHub Desktop.
ObjectiveDDP + ReactiveCocoa
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:MeteorClientDidConnectNotification object:nil] subscribeNext:^(id x) { | |
NSLog(@"connected to server!"); | |
}]; | |
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:MeteorClientDidDisconnectNotification object:nil] subscribeNext:^(id x) { | |
NSLog(@"disconnected from server!"); | |
}]; | |
return YES; | |
} |
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reportConnection) name:MeteorClientDidConnectNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reportDisconnection) name:MeteorClientDidDisconnectNotification object:nil]; | |
return YES; | |
} | |
- (void)reportConnection | |
{ | |
NSLog(@"connected to server!"); | |
} | |
- (void)reportDisconnection | |
{ | |
NSLog(@"disconnected from server!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment