AOS_iOS_NRE_Sample/Nexacro14/iOS/nexacro14_iOS/nexacro14App/AppDelegate.m

94 lines
3.7 KiB
Mathematica
Raw Normal View History

2023-09-18 15:32:28 +09:00
//
// AppDelegate.m
// nexacro14App
//
// Created by on 2016. 11. 24..
// Copyright © 2016 com.tobesoft. All rights reserved.
//
#import "AppDelegate.h"
@implementation AppViewController
// (YES/NO)
- (BOOL)shouldAutorotate
{
return YES;
}
// ( )
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
@end
@implementation AppDelegate
- (NexacroMainViewController*)initializeMainViewController
{
NSString *bootstrapUrl = @"http://172.10.12.59:8080/nexacro17/TopsIssueLoader/_ios_/start_ios.json";
[[NexacroResourceManager sharedResourceManager] setBootstrapURL:bootstrapUrl isDirect:NO];
// WKWebView delegate
AppViewController* controller = [[AppViewController alloc] initWithFullScreen:NO];
// WKWebView delegate
// WebViewDelegate* webviewDelegate = [[WebViewDelegate alloc] init];
// AppViewController* controller = [[AppViewController alloc] initWithFullScreen:NO
// withWebviewDelegate:webviewDelegate];
return controller;
}
@end
// WKWebView delegate AppViewController
@implementation WebViewDelegate
#pragma mark - WKWebView - WKScriptMessageHandler
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
{
[super userContentController:userContentController didReceiveScriptMessage:message];
}
#pragma mark - WKWebView - WKNavigationDelegate
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(nonnull WKNavigationAction *)navigationAction decisionHandler:(nonnull void (^)(WKNavigationActionPolicy))decisionHandler
{
[super webView:webView decidePolicyForNavigationAction:navigationAction decisionHandler:decisionHandler];
}
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation
{
[super webView:webView didCommitNavigation:navigation];
}
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{
[super webView:webView didFinishNavigation:navigation];
}
- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error
{
[super webView:webView didFailNavigation:navigation withError:error];
}
#pragma mark - WKWebView - WKUIDelegate
- (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler
{
[super webView:webView runJavaScriptAlertPanelWithMessage:message initiatedByFrame:frame completionHandler:completionHandler];
}
- (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL result))completionHandler
{
[super webView:webView runJavaScriptConfirmPanelWithMessage:message initiatedByFrame:frame completionHandler:completionHandler];
}
- (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(nullable NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSString * __nullable result))completionHandler
{
[super webView:webView runJavaScriptTextInputPanelWithPrompt:prompt defaultText:defaultText initiatedByFrame:frame completionHandler:completionHandler];
}
@end