refact some code
This commit is contained in:
@@ -95,20 +95,20 @@ - (void)sendDevCommand:(NSString *)command {
|
||||
}
|
||||
|
||||
- (void)onOpenEvent {
|
||||
ShowToast(@"dev kit connected", DoricBottom);
|
||||
ShowToast(@"dev kit connected", DoricGravityBottom);
|
||||
}
|
||||
|
||||
- (void)onEOFEvent {
|
||||
ShowToast(@"dev kit eof exception", DoricBottom);
|
||||
ShowToast(@"dev kit eof exception", DoricGravityBottom);
|
||||
}
|
||||
|
||||
- (void)onConnectExceptionEvent {
|
||||
ShowToast(@"dev kit connection exception", DoricBottom);
|
||||
ShowToast(@"dev kit connection exception", DoricGravityBottom);
|
||||
}
|
||||
|
||||
- (void)onStartDebugEvent:(NSNotification *)notification {
|
||||
NSString *contextId = notification.object;
|
||||
ShowToast(contextId, DoricBottom);
|
||||
ShowToast(contextId, DoricGravityBottom);
|
||||
for (NSValue *value in [[DoricContextManager instance] aliveContexts]) {
|
||||
DoricContext *context = value.nonretainedObjectValue;
|
||||
BOOL result = [context.contextId compare:contextId] == NSOrderedSame;
|
||||
|
@@ -53,7 +53,7 @@ - (void)viewDidLoad {
|
||||
NSString *result = @"127.0.0.1";
|
||||
[DoricJSRemoteExecutor configIp:result];
|
||||
[[DoricDev instance] connectDevKit:[NSString stringWithFormat:@"ws://%@:7777", result]];
|
||||
ShowToast([NSString stringWithFormat:@"Connected to %@", result], DoricBottom);
|
||||
ShowToast([NSString stringWithFormat:@"Connected to %@", result], DoricGravityBottom);
|
||||
} else {
|
||||
[self.navigationController pushViewController:[QRScanViewController new] animated:NO];
|
||||
}
|
||||
|
@@ -106,7 +106,7 @@ - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:
|
||||
NSLog(@"Scan result is %@", result);
|
||||
[[DoricDev instance] connectDevKit:[NSString stringWithFormat:@"ws://%@:7777", result]];
|
||||
[DoricJSRemoteExecutor configIp:result];
|
||||
ShowToast([NSString stringWithFormat:@"Connected to %@", result], DoricBottom);
|
||||
ShowToast([NSString stringWithFormat:@"Connected to %@", result], DoricGravityBottom);
|
||||
[self.navigationController popViewControllerAnimated:NO];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user