Fixes ITMS-90809 about UIWebView deprecation (#390)
This commit is contained in:
parent
2ec7cb5ce0
commit
5a175f44a0
2 changed files with 3 additions and 2 deletions
|
@ -45,7 +45,7 @@ def open_url_wbv(url, width, height):
|
||||||
`width`: int
|
`width`: int
|
||||||
Width of the window
|
Width of the window
|
||||||
|
|
||||||
Example for opening up a web page in UIWebview::
|
Example for opening up a web page in WKWebview::
|
||||||
|
|
||||||
import ios
|
import ios
|
||||||
url = "http://www.google.com"
|
url = "http://www.google.com"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
#include <WebKit/WebKit.h>
|
||||||
#include "ios_wrapper.h"
|
#include "ios_wrapper.h"
|
||||||
|
|
||||||
void ios_open_url(char *url)
|
void ios_open_url(char *url)
|
||||||
|
@ -18,7 +19,7 @@ void ios_open_url(char *url)
|
||||||
void load_url_webview(char *url, int width, int height)
|
void load_url_webview(char *url, int width, int height)
|
||||||
{
|
{
|
||||||
NSString *nsurl = [NSString stringWithCString:(char *)url encoding:NSUTF8StringEncoding];
|
NSString *nsurl = [NSString stringWithCString:(char *)url encoding:NSUTF8StringEncoding];
|
||||||
UIWebView *webView = [[UIWebView alloc] initWithFrame: CGRectMake(0, 0, width, height)];
|
WKWebView *webView = [[WKWebView alloc] initWithFrame: CGRectMake(0, 0, width, height)];
|
||||||
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
|
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
|
||||||
UIView *view = [window.rootViewController view];
|
UIView *view = [window.rootViewController view];
|
||||||
[view addSubview:webView];
|
[view addSubview:webView];
|
||||||
|
|
Loading…
Reference in a new issue