Skip to content
Browse files

adding notifications for swyp events.

  • Loading branch information...
1 parent 070ed91 commit da36361e0b502ea529c20d3ec427018a71358569 @sherbondy sherbondy committed Mar 31, 2012
Showing with 9 additions and 3 deletions.
  1. +3 −3 libSwyp/swypConnectionManager.m
  2. +6 −0 libSwyp/swypWorkspaceViewController.m
View
6 libSwyp/swypConnectionManager.m
@@ -176,6 +176,8 @@ -(void) connectionSessionWasCreatedSuccessfully: (swypConnectionSession*)session
}else if (ref.swypType == swypInfoRefTypeSwypOut){
[self dropSwypOutSwypInfoRefFromAdvertisers:ref];
}
+
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:@"swypConnected" object:nil]];
[session addDataDelegate:self];
[session addConnectionSessionInfoDelegate:self];
@@ -187,7 +189,6 @@ -(void) connectionSessionWasCreatedSuccessfully: (swypConnectionSession*)session
#pragma mark SWYP Responders
#pragma mark IN
-(void) swypInCompletedWithSwypInfoRef: (swypInfoRef*)inInfo{
-
NSMutableArray * addedInterfacesForSwypIn = [NSMutableArray array];
if (self.activeConnectionMethods & swypConnectionMethodWifiCloud){
[_cloudPairManager startFindingSwypInServerCandidatesForRef:inInfo];
@@ -248,8 +249,7 @@ -(void) swypOutStartedWithSwypInfoRef: (swypInfoRef*)outInfo{
[_handshakeManager referenceSwypOutAsPending:outInfo];
}
}
--(void) swypOutCompletedWithSwypInfoRef:(swypInfoRef*)outInfo{
-
+-(void) swypOutCompletedWithSwypInfoRef:(swypInfoRef*)outInfo {
NSMutableArray * addedInterfacesForSwypOut = [NSMutableArray array];
if (self.activeConnectionMethods & swypConnectionMethodWifiCloud){
[_cloudPairManager advertiseSwypOutAsCompleted:outInfo];
View
6 libSwyp/swypWorkspaceViewController.m
@@ -256,12 +256,18 @@ -(void)networkInterfaceClassButtonPressed:(id)sender{
#pragma mark UIGestureRecognizerDelegate
-(void) swypInGestureChanged:(swypInGestureRecognizer*)recognizer{
if (recognizer.state == UIGestureRecognizerStateRecognized){
+ [[NSNotificationCenter defaultCenter]
+ postNotification:[NSNotification notificationWithName:@"swypOut"
+ object:@{@"gesture":[recognizer swypGestureInfo]}]];
[_connectionManager swypInCompletedWithSwypInfoRef:[recognizer swypGestureInfo]];
}
}
-(void) swypOutGestureChanged:(swypOutGestureRecognizer*)recognizer{
if (recognizer.state == UIGestureRecognizerStateBegan){
+ [[NSNotificationCenter defaultCenter]
+ postNotification:[NSNotification notificationWithName:@"swypOut"
+ object:@{@"gesture":[recognizer swypGestureInfo]}]];
[_connectionManager swypOutStartedWithSwypInfoRef:[recognizer swypGestureInfo]];
}else if (recognizer.state == UIGestureRecognizerStateCancelled){
[_connectionManager swypOutFailedWithSwypInfoRef:[recognizer swypGestureInfo]];

0 comments on commit da36361

Please sign in to comment.
Something went wrong with that request. Please try again.