forked from marcuswestin/WebViewJavascriptBridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExampleAppDelegate.m
More file actions
30 lines (23 loc) · 1.23 KB
/
ExampleAppDelegate.m
File metadata and controls
30 lines (23 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#import "ExampleAppDelegate.h"
#import "ExampleUIWebViewController.h"
#import "ExampleWKWebViewController.h"
@implementation ExampleAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// 1. Create the UIWebView example
ExampleUIWebViewController* UIWebViewExampleController = [[ExampleUIWebViewController alloc] init];
UIWebViewExampleController.tabBarItem.title = @"UIWebView";
// 2. Create the tab footer and add the UIWebView example
UITabBarController *tabBarController = [[UITabBarController alloc] init];
[tabBarController addChildViewController:UIWebViewExampleController];
// 3. Create the WKWebView example for devices >= iOS 8
if([WKWebView class]) {
ExampleWKWebViewController* WKWebViewExampleController = [[ExampleWKWebViewController alloc] init];
WKWebViewExampleController.tabBarItem.title = @"WKWebView";
[tabBarController addChildViewController:WKWebViewExampleController];
}
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
@end