Skip to content

Commit

Permalink
Added compiler flags to include Yosemite
Browse files Browse the repository at this point in the history
  • Loading branch information
lokimeyburg committed Oct 15, 2014
1 parent 026a712 commit b458d79
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 5 additions & 1 deletion Example Apps/ExampleApp-iOS/ExampleAppViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@

#import <UIKit/UIKit.h>

#if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9 || __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1)
#define exampleSupportsWKWebKit
#endif


#if defined(__IPHONE_8_0)
#if defined(exampleSupportsWKWebKit)
#import <WebKit/WebKit.h>
#define EXAMPLE_WEBVIEW_TYPE WKWebView
#define EXAMPLE_WEBVIEW_DELEGATE_TYPE NSObject<WKNavigationDelegate>
Expand Down
7 changes: 4 additions & 3 deletions Example Apps/ExampleApp-iOS/ExampleAppViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "ExampleAppViewController.h"

#if defined(__IPHONE_8_0)
#if defined(exampleSupportsWKWebKit)
#import "WKWebViewJavascriptBridge.h"
# else
#import "WebViewJavascriptBridge.h"
Expand All @@ -24,8 +24,9 @@ @implementation ExampleAppViewController

- (void)viewWillAppear:(BOOL)animated {
if (_bridge) { return; }

#if defined(__IPHONE_8_0)

#if defined(exampleSupportsWKWebKit)
NSLog(@"---------------------------------------");
WKWebView* webView = [[NSClassFromString(@"WKWebView") alloc] initWithFrame:self.view.bounds];
webView.navigationDelegate = self;
[self.view addSubview:webView];
Expand Down
6 changes: 5 additions & 1 deletion WebViewJavascriptBridge/WKWebViewJavascriptBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
// Copyright (c) 2014 Loki Meyburg. All rights reserved.
//

#if defined(__IPHONE_8_0)
#if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9 || __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1)
#define supportsWKWebKit
#endif

#if defined(supportsWKWebKit )

#import <Foundation/Foundation.h>
#define kCustomProtocolScheme @"wvjbscheme"
Expand Down
3 changes: 2 additions & 1 deletion WebViewJavascriptBridge/WKWebViewJavascriptBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
// Copyright (c) 2014 Loki Meyburg. All rights reserved.
//

#if defined(__IPHONE_8_0)

#import "WKWebViewJavascriptBridge.h"

#if defined(supportsWKWebKit)

typedef NSDictionary WVJBMessage;

@implementation WKWebViewJavascriptBridge {
Expand Down

0 comments on commit b458d79

Please sign in to comment.