Plugin with UIViewController

浪子不回头ぞ 提交于 2019-11-30 07:07:37

If you want to present the whole UIViewController (full screen) over the cordova webview, you can do

[self.viewController presentViewController:yourViewController animated:YES completion:nil];

Examples:

Camera plugin

InAppBrowser plugin

If you want to add just a view over the cordova webview, you can do

[self.viewController.view addSubview:yourView];

Examples:

MapKit plugin

The diference is, that the first method present the whole view controller, full screen, the second method shows a view that can have the size and position you want, if you don't make it have the same size of the device screen the user will see your cordova webview under it

Please refer the answer given by @jcesarmobile above

Plugin with UIViewController

For immature iOS developers like me who were not able to identify how to define yourViewController, follow below code

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController * yourViewController = [storyboard   instantiateViewControllerWithIdentifier:@"iController"] ;
[self.viewController presentViewController: yourViewController animated:YES completion:nil];

Where Main is the storyboard filename and iController is the viewController's storyboardIdentifier defined in the Main.Storyboard file

Please up vote the above answer given by @jcesarmobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!