玩瞳文档中心


MainViewController

<p>初始化识别SDK,设置回调 并添加通知,可依需求添加 </p> <pre><code>-(void)initData{ isNetworkReachability=YES; self.initLicenseSuccess = false; self.mainBll = [[VTMainBLLObj alloc]init]; self.mainBll.resoureUpdateDelegate = self; self.mainBll.audioStatusDelegate = self; self.mainBll.loginDelegate = self; self.animationManager = [[VTAnimationManager alloc] init]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(presentVController) name:@"custom_viewwillappear" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkDidReachable) name:@"NetworkReachabilityStatusReachable" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkDidNotReachable) name:@"NetworkReachabilityStatusNotReachable" object:nil]; }</code></pre> <p>开始判断是否授权及开始识别流程,Demo中是通过通知调用,如自定义跳转此识别VC,可在需要位置主动调用</p> <pre><code>-(void)presentVController{ CustomMainView *customView = [[CustomMainView alloc]initWithFrame:[UIScreen mainScreen].bounds]; self.mainView = customView; [self.view addSubview:self.mainView]; BOOL isAuthorizd = [[NSUserDefaults standardUserDefaults] boolForKey:@"authorize"]; NSString *license = [[NSUserDefaults standardUserDefaults] stringForKey:@"license"]; if (!isAuthorizd || !license) { Class targetClass = NSClassFromString(@"ScanQRCodeViewController"); UIViewController *target = [[targetClass alloc] init]; [self presentViewController:target animated:YES completion:nil]; return; } [self customViewWillAppear]; }</code></pre> <p>其余回调接口,请参考SDK接口说明</p>

页面列表

ITEM_HTML