// // WebPageViewController.m // Unity-iPhone // // Created by Hl Zhang on 2023/3/14. // #import "WebPageViewController.h" #import #define SCREENWIDTH [UIScreen mainScreen].bounds.size.width #define SCREENHEIGHT [UIScreen mainScreen].bounds.size.height @interface WebPageViewController () @property (nonatomic, strong) WKWebView *webView; @end @implementation WebPageViewController - (void)viewDidLoad { [super viewDidLoad]; // Create the WKWebView self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; [self.view addSubview:self.webView]; // Load the URL NSURL *url = [NSURL URLWithString:self.url]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [self.webView loadRequest:request]; } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end