迁移仓库
This commit is contained in:
38
ShenQi/GameWebViewController.m
Normal file
38
ShenQi/GameWebViewController.m
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// GameWebViewController.m
|
||||
// ShenQi
|
||||
//
|
||||
// Created by Qwerdf on 2025/11/11.
|
||||
//
|
||||
|
||||
#import "GameWebViewController.h"
|
||||
|
||||
@interface GameWebViewController ()<WKUIDelegate,WKNavigationDelegate>
|
||||
|
||||
@property (strong, nonatomic) WKWebView *webView;
|
||||
@property (nonatomic,strong) WKUserContentController *wkUController;
|
||||
|
||||
@end
|
||||
|
||||
@implementation GameWebViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
WKWebViewConfiguration *wkWebConfig = [[WKWebViewConfiguration alloc] init];
|
||||
wkWebConfig.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
|
||||
|
||||
_wkUController = [[WKUserContentController alloc] init];
|
||||
|
||||
wkWebConfig.userContentController = _wkUController;
|
||||
|
||||
UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].windows.lastObject.windowScene.statusBarManager;
|
||||
_webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, statusBarManager.statusBarFrame.size.height, self.view.bounds.size.width, self.view.bounds.size.height-self.view.safeAreaInsets.bottom-statusBarManager.statusBarFrame.size.height) configuration:self.gameConfiguration];
|
||||
_webView.UIDelegate = self;
|
||||
_webView.navigationDelegate = self;
|
||||
[self.view addSubview:_webView];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user