Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios=>当多个页面集成了人脸活体检测功能,有的页面调不起来人脸识别的页面。 #2

Open
ZhangTaoK opened this issue Oct 26, 2018 · 1 comment

Comments

@ZhangTaoK
Copy link

xcode 报错误警告

which is already presenting...

导致FaceCheckHelper.openPushFaceViewController(obj);调不起来原生人脸识别的页面。

因为:
popover中的控制器, 其实是通过窗口的根控制器presenting出来的, 所以要想窗口的根控制器再presenting其他控制器,需要先dismiss掉原来presenting的控制器

解决方案:
在xcode中打开PushFaceViewControllerModule.m

找到以下代码:
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:lvc];
nav.navigationBarHidden = true;
AppDelegate *app = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[app.window.rootViewController presentViewController:nav animated:YES completion:nil];

修改为以下代码:
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:lvc];
nav.navigationBarHidden = true;
AppDelegate *app = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[app.window.rootViewController dismissViewControllerAnimated:YES completion:nil];
[app.window.rootViewController presentViewController:nav animated:YES completion:nil];

在presentViewController之前加入dismiss的方法就可以了。

加入代码:[app.window.rootViewController dismissViewControllerAnimated:YES completion:nil];

如果有更好的方法,请留言。

@songxiaoliang
Copy link
Owner

@ZhangTaoK 已将pr建议采纳,合并master。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants