Skip to content

Commit

Permalink
WKWebView example only available on iOS 8 devices
Browse files Browse the repository at this point in the history
  • Loading branch information
lokimeyburg committed Nov 9, 2014
1 parent 59d4f19 commit a7c4a03
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Example Apps/ExampleApp-iOS.xcodeproj/project.pbxproj
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
0E4E9D4C1A101E0B00043087 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E8082DC19EDD98700479452 /* WebKit.framework */; };
0E50601C1A01B442000BEEEA /* WebViewJavascriptBridgeBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E50601B1A01B442000BEEEA /* WebViewJavascriptBridgeBase.m */; };
0E8082DB19EDC32300479452 /* WKWebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8082DA19EDC32300479452 /* WKWebViewJavascriptBridge.m */; };
0ECB01441A0EE1F20037FF4E /* ExampleWKWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0ECB01431A0EE1F20037FF4E /* ExampleWKWebViewController.m */; };
Expand Down Expand Up @@ -55,6 +56,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0E4E9D4C1A101E0B00043087 /* WebKit.framework in Frameworks */,
2CEB3EC01602563600548120 /* UIKit.framework in Frameworks */,
2CEB3EC21602563600548120 /* Foundation.framework in Frameworks */,
2CEB3EC41602563600548120 /* CoreGraphics.framework in Frameworks */,
Expand Down Expand Up @@ -278,6 +280,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ExampleApp-iOS/ExampleApp-iOS-Prefix.pch";
INFOPLIST_FILE = "ExampleApp-iOS/ExampleApp-iOS-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
PRODUCT_NAME = "ExampleApp-iOS";
WRAPPER_EXTENSION = app;
};
Expand All @@ -289,6 +292,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ExampleApp-iOS/ExampleApp-iOS-Prefix.pch";
INFOPLIST_FILE = "ExampleApp-iOS/ExampleApp-iOS-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
PRODUCT_NAME = "ExampleApp-iOS";
WRAPPER_EXTENSION = app;
};
Expand Down
17 changes: 10 additions & 7 deletions Example Apps/ExampleApp-iOS/ExampleAppDelegate.m
Expand Up @@ -6,18 +6,21 @@ @implementation ExampleAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// 1. Create the UIWebView example
ExampleUIWebViewController* UIWebViewExampleController = [[ExampleUIWebViewController alloc] init];
UIWebViewExampleController.tabBarItem.title = @"UIWebView";

ExampleWKWebViewController* WKWebViewExampleController = [[ExampleWKWebViewController alloc] init];
WKWebViewExampleController.tabBarItem.title = @"WKWebView";


// 2. Create the tab footer and add the UIWebView example
UITabBarController *tabBarController = [[UITabBarController alloc] init];
[tabBarController addChildViewController:UIWebViewExampleController];
[tabBarController addChildViewController:WKWebViewExampleController];



// 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];
Expand Down

0 comments on commit a7c4a03

Please sign in to comment.