11 |
12 | @interface JsWebViewTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation JsWebViewTests
17 |
18 | - (void)setUp {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown {
24 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 xdf
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # JsWebView
2 |
3 | ## Preview
4 |
5 | 
6 |
7 | ## Usage
8 |
9 | ### Installation
10 |
11 | copy `JsWebViewController.h`, `JsWebViewController.m` into your project.
12 |
13 |
14 | Add the following import to the top of the file:
15 |
16 | ``` objc
17 | #import "JsWebViewController.h"
18 | ```
19 |
20 | ### Configuration
21 |
22 | ``` objc
23 | JsWebViewController *view = [[JsWebViewController alloc] init];
24 | ...
25 | view.url = url;
26 | ```
27 |
28 | ### Usage
29 |
30 | ``` javascript
31 | var callback = function() {
32 |
33 | $('#pushView').addEventListener('click', function() {
34 | JSBridge.invoke('pushView', {
35 | url: 'index.html'
36 | });
37 | }, false);
38 |
39 | $('#popView').addEventListener('click', function() {
40 | JSBridge.invoke('popView');
41 | }, false);
42 |
43 | $('#setTitle').addEventListener('click', function() {
44 | JSBridge.invoke('setTitle', 'newTitle');
45 | }, false);
46 | };
47 |
48 | document.addEventListener('JSBridgeReady', function() {
49 | callback();
50 | }, false);
51 | ```
52 |
53 | ## License
54 |
55 | The MIT License (MIT)
56 |
57 | Copyright (c) 2015 xdf
58 |
--------------------------------------------------------------------------------
/JsWebView/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | xudafeng.com.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/JsWebView/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | title
12 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/JsWebView/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/JsWebView/lib/JSBridge.js:
--------------------------------------------------------------------------------
1 | /*
2 | JSWebView.js
3 | JsWebView
4 |
5 | Created by xdf on 4/30/15.
6 | Copyright (c) 2015 xdf. All rights reserved.
7 | */
8 |
9 | ;(function(global) {
10 | 'use strict';
11 |
12 | var doc = document;
13 | var methods = {};
14 |
15 | var Util = {
16 | slice: Array.prototype.slice
17 | };
18 |
19 | var _exec = function(host, querystring) {
20 | var url = 'jsbridge://' + host;
21 |
22 | if (querystring) {
23 | var qs = [];
24 | for (var i in querystring) {
25 | qs.push(i + '=' + querystring[i]);
26 | }
27 | url += '?' + encodeURIComponent(qs.join('&'));
28 | }
29 | global.location.href = url;
30 | };
31 |
32 | methods.setTitle = function() {
33 | var args = Util.slice.call(arguments);
34 | var title = args[0];
35 |
36 | _exec('setTitle', {
37 | title: title
38 | });
39 | };
40 |
41 | methods.pushView = function() {
42 | var args = Util.slice.call(arguments);
43 |
44 | _exec('pushView', args[0][0]);
45 | };
46 |
47 | methods.popView = function() {
48 | _exec('popView');
49 | };
50 |
51 | var _init = function() {
52 | this.methods = methods;
53 | };
54 |
55 | var _invoke = function() {
56 | var args = Util.slice.call(arguments);
57 |
58 | if (!args) {
59 | alert('arguments error');
60 | }
61 |
62 | var method = args.shift();
63 |
64 | try {
65 | this.methods[method].call(global, args);
66 | } catch(e) {
67 | alert(e.stack);
68 | }
69 | };
70 |
71 | var JSBridge = {
72 | init: _init,
73 | invoke: _invoke
74 | };
75 |
76 | JSBridge.init();
77 |
78 | var readyEvent = doc.createEvent('Events');
79 | readyEvent.initEvent('JSBridgeReady');
80 | doc.dispatchEvent(readyEvent);
81 |
82 | global.JSBridge = JSBridge;
83 | })(this);
84 |
--------------------------------------------------------------------------------
/JsWebView/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // JsWebView
4 | //
5 | // Created by xdf on 5/2/15.
6 | // Copyright (c) 2015 xdf. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "JsWebViewController.h"
11 |
12 | @interface AppDelegate ()
13 |
14 | @end
15 |
16 | @implementation AppDelegate
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | JsWebViewController *view = [[JsWebViewController alloc] init];
20 | NSString *url = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
21 | view.url = url;
22 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController: view];
23 | self.window.rootViewController = nav;
24 | return YES;
25 | }
26 |
27 | - (void)applicationWillResignActive:(UIApplication *)application {
28 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
29 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
30 | }
31 |
32 | - (void)applicationDidEnterBackground:(UIApplication *)application {
33 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
35 | }
36 |
37 | - (void)applicationWillEnterForeground:(UIApplication *)application {
38 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
39 | }
40 |
41 | - (void)applicationDidBecomeActive:(UIApplication *)application {
42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
43 | }
44 |
45 | - (void)applicationWillTerminate:(UIApplication *)application {
46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/JsWebView/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/JsWebView/lib/JsWebViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // JsWebViewController.m
3 | // JsWebView
4 | //
5 | // Created by xdf on 4/29/15.
6 | // Copyright (c) 2015 xdf. All rights reserved.
7 | //
8 |
9 | #import "JsWebViewController.h"
10 |
11 | @interface JsWebViewController ()
12 | @property (strong, nonatomic) UIWebView *webView;
13 | @property (strong, nonatomic) UIActivityIndicatorView *activityIndicator;
14 | @end
15 |
16 | @implementation JsWebViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | [self initView];
21 | }
22 |
23 | - (void)initNavagationBar {
24 | self.navigationItem.title = @"loading...";
25 | self.navigationController.view.backgroundColor = [UIColor whiteColor];
26 | }
27 |
28 | - (void)setNavagationBar {
29 | NSString *title = [self.webView stringByEvaluatingJavaScriptFromString: @"document.title"];
30 | self.navigationItem.title = title;
31 | }
32 |
33 | - (void)initView {
34 | [self initNavagationBar];
35 | [self initWebview];
36 | }
37 |
38 | - (void)initWebview {
39 | self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
40 | [self.webView setScalesPageToFit: YES];
41 | self.webView.delegate = self;
42 | [self preventWebviewScroll];
43 | [self.view addSubview: self.webView];
44 | NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString: self.url]];
45 | [self.webView loadRequest:request];
46 | }
47 |
48 | - (void)preventWebviewScroll {
49 | self.webView.scrollView.bounces = NO;
50 | UIScrollView *scollview = (UIScrollView *)[[self.webView subviews]objectAtIndex:0];
51 | scollview.bounces = NO;
52 | }
53 |
54 | - (void)didReceiveMemoryWarning {
55 | [super didReceiveMemoryWarning];
56 | }
57 |
58 | #pragma mark - webview delegate method
59 |
60 | - (void)webViewDidStartLoad:(UIWebView *)webView {
61 | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
62 | [view setTag:108];
63 | [view setBackgroundColor:[UIColor blackColor]];
64 | [view setAlpha:0.2];
65 | [self.view addSubview:view];
66 | self.activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
67 | [self.activityIndicator setCenter:view.center];
68 | [self.activityIndicator setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite];
69 | [view addSubview: self.activityIndicator];
70 | [self.activityIndicator startAnimating];
71 | NSLog(@"webViewDidStartLoad");
72 | }
73 |
74 | - (void)webViewDidFinishLoad:(UIWebView *)webView {
75 | [self.activityIndicator stopAnimating];
76 | UIView *view = (UIView*)[self.view viewWithTag:108];
77 | [view removeFromSuperview];
78 | [self setNavagationBar];
79 |
80 | NSBundle *bundle = [NSBundle mainBundle];
81 | NSString *filePath = [bundle pathForResource:@"JSBridge" ofType:@"js"];
82 | NSLog(@"%@", filePath);
83 | NSString *javascript = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
84 | [webView stringByEvaluatingJavaScriptFromString: javascript];
85 | NSLog(@"webViewDidFinishLoad");
86 | }
87 |
88 | - (void)setTitle:(NSString *)query {
89 | NSMutableDictionary *dict = [self parseQuery: query];
90 | self.navigationItem.title = [dict objectForKey:@"title"];
91 | }
92 |
93 | - (void)pushView:(NSString *)query {
94 | NSMutableDictionary *dict = [self parseQuery: query];
95 | NSString *url = [dict objectForKey: @"url"];
96 | JsWebViewController *nextViewController = [[JsWebViewController alloc] init];
97 | NSString* path = [[NSBundle mainBundle] pathForResource: url ofType: @""];
98 | nextViewController.url = path;
99 | NSString *title = [dict objectForKey:@"title"];
100 | if (title) {
101 | nextViewController.navigationItem.title = title;
102 | }
103 | [self.navigationController pushViewController:nextViewController animated:YES];
104 | }
105 |
106 | - (void)popView {
107 | [self.navigationController popViewControllerAnimated:YES];
108 | }
109 |
110 | - (NSMutableDictionary *)parseQuery:(NSString *)query {
111 | NSString *temp = [query stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
112 | NSArray *queryArray = [temp componentsSeparatedByString:@"&"];
113 | NSInteger count = [queryArray count];
114 | NSMutableDictionary *dict = [NSMutableDictionary dictionary];
115 |
116 | for (NSInteger i = 0 ; i < count; i++) {
117 | NSString *temp = [queryArray objectAtIndex:i];
118 | NSArray *tempArray = [temp componentsSeparatedByString:@"="];
119 | [dict setObject: tempArray[1] forKey: tempArray[0]];
120 | }
121 | return dict;
122 | }
123 |
124 | - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
125 | NSURL *url = request.mainDocumentURL;
126 | NSString *scheme = request.URL.scheme;
127 | NSString *host = [url host];
128 | NSString *query = [url query];
129 | NSArray *methods = [NSArray arrayWithObjects:@"setTitle", @"pushView", @"popView", nil];
130 |
131 | if ([scheme isEqualToString: CustomProtocolScheme]) {
132 | NSInteger index = [methods indexOfObject: host];
133 | switch (index) {
134 | case 0:
135 | [self setTitle: query];
136 | break;
137 | case 1:
138 | [self pushView: query];
139 | break;
140 | case 2:
141 | [self popView];
142 | break;
143 | default:
144 | break;
145 | }
146 | return NO;
147 | } else {
148 | switch (navigationType) {
149 | case UIWebViewNavigationTypeLinkClicked:
150 | NSLog(@"clicked");
151 | break;
152 | case UIWebViewNavigationTypeFormSubmitted:
153 | NSLog(@"submitted");
154 | default:
155 | break;
156 | }
157 | return YES;
158 | }
159 | }
160 |
161 | @end
--------------------------------------------------------------------------------
/JsWebView.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 637DDE891AF3EEF600687C6A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 637DDE881AF3EEF600687C6A /* main.m */; };
11 | 637DDE8C1AF3EEF600687C6A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 637DDE8B1AF3EEF600687C6A /* AppDelegate.m */; };
12 | 637DDE8F1AF3EEF600687C6A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 637DDE8E1AF3EEF600687C6A /* ViewController.m */; };
13 | 637DDE921AF3EEF600687C6A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 637DDE901AF3EEF600687C6A /* Main.storyboard */; };
14 | 637DDE941AF3EEF600687C6A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 637DDE931AF3EEF600687C6A /* Images.xcassets */; };
15 | 637DDE971AF3EEF600687C6A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 637DDE951AF3EEF600687C6A /* LaunchScreen.xib */; };
16 | 637DDEA31AF3EEF600687C6A /* JsWebViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 637DDEA21AF3EEF600687C6A /* JsWebViewTests.m */; };
17 | 637DDEB11AF3F0AB00687C6A /* JsWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 637DDEAE1AF3F0AB00687C6A /* JsWebViewController.m */; };
18 | 637DDEB21AF3F0AB00687C6A /* JSBridge.js in Resources */ = {isa = PBXBuildFile; fileRef = 637DDEAF1AF3F0AB00687C6A /* JSBridge.js */; };
19 | 637DDEB41AF3F3C600687C6A /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 637DDEB31AF3F3C600687C6A /* index.html */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXContainerItemProxy section */
23 | 637DDE9D1AF3EEF600687C6A /* PBXContainerItemProxy */ = {
24 | isa = PBXContainerItemProxy;
25 | containerPortal = 637DDE7B1AF3EEF600687C6A /* Project object */;
26 | proxyType = 1;
27 | remoteGlobalIDString = 637DDE821AF3EEF600687C6A;
28 | remoteInfo = JsWebView;
29 | };
30 | /* End PBXContainerItemProxy section */
31 |
32 | /* Begin PBXFileReference section */
33 | 637DDE831AF3EEF600687C6A /* JsWebView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JsWebView.app; sourceTree = BUILT_PRODUCTS_DIR; };
34 | 637DDE871AF3EEF600687C6A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
35 | 637DDE881AF3EEF600687C6A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
36 | 637DDE8A1AF3EEF600687C6A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
37 | 637DDE8B1AF3EEF600687C6A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
38 | 637DDE8D1AF3EEF600687C6A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
39 | 637DDE8E1AF3EEF600687C6A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
40 | 637DDE911AF3EEF600687C6A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
41 | 637DDE931AF3EEF600687C6A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
42 | 637DDE961AF3EEF600687C6A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
43 | 637DDE9C1AF3EEF600687C6A /* JsWebViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JsWebViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
44 | 637DDEA11AF3EEF600687C6A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | 637DDEA21AF3EEF600687C6A /* JsWebViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JsWebViewTests.m; sourceTree = ""; };
46 | 637DDEAE1AF3F0AB00687C6A /* JsWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JsWebViewController.m; path = lib/JsWebViewController.m; sourceTree = ""; };
47 | 637DDEAF1AF3F0AB00687C6A /* JSBridge.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = JSBridge.js; path = lib/JSBridge.js; sourceTree = ""; };
48 | 637DDEB01AF3F0AB00687C6A /* JsWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JsWebViewController.h; path = lib/JsWebViewController.h; sourceTree = ""; };
49 | 637DDEB31AF3F3C600687C6A /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; };
50 | /* End PBXFileReference section */
51 |
52 | /* Begin PBXFrameworksBuildPhase section */
53 | 637DDE801AF3EEF600687C6A /* Frameworks */ = {
54 | isa = PBXFrameworksBuildPhase;
55 | buildActionMask = 2147483647;
56 | files = (
57 | );
58 | runOnlyForDeploymentPostprocessing = 0;
59 | };
60 | 637DDE991AF3EEF600687C6A /* Frameworks */ = {
61 | isa = PBXFrameworksBuildPhase;
62 | buildActionMask = 2147483647;
63 | files = (
64 | );
65 | runOnlyForDeploymentPostprocessing = 0;
66 | };
67 | /* End PBXFrameworksBuildPhase section */
68 |
69 | /* Begin PBXGroup section */
70 | 637DDE7A1AF3EEF600687C6A = {
71 | isa = PBXGroup;
72 | children = (
73 | 637DDE851AF3EEF600687C6A /* JsWebView */,
74 | 637DDE9F1AF3EEF600687C6A /* JsWebViewTests */,
75 | 637DDE841AF3EEF600687C6A /* Products */,
76 | );
77 | sourceTree = "";
78 | };
79 | 637DDE841AF3EEF600687C6A /* Products */ = {
80 | isa = PBXGroup;
81 | children = (
82 | 637DDE831AF3EEF600687C6A /* JsWebView.app */,
83 | 637DDE9C1AF3EEF600687C6A /* JsWebViewTests.xctest */,
84 | );
85 | name = Products;
86 | sourceTree = "";
87 | };
88 | 637DDE851AF3EEF600687C6A /* JsWebView */ = {
89 | isa = PBXGroup;
90 | children = (
91 | 637DDEB31AF3F3C600687C6A /* index.html */,
92 | 637DDEAE1AF3F0AB00687C6A /* JsWebViewController.m */,
93 | 637DDEAF1AF3F0AB00687C6A /* JSBridge.js */,
94 | 637DDEB01AF3F0AB00687C6A /* JsWebViewController.h */,
95 | 637DDE8A1AF3EEF600687C6A /* AppDelegate.h */,
96 | 637DDE8B1AF3EEF600687C6A /* AppDelegate.m */,
97 | 637DDE8D1AF3EEF600687C6A /* ViewController.h */,
98 | 637DDE8E1AF3EEF600687C6A /* ViewController.m */,
99 | 637DDE901AF3EEF600687C6A /* Main.storyboard */,
100 | 637DDE931AF3EEF600687C6A /* Images.xcassets */,
101 | 637DDE951AF3EEF600687C6A /* LaunchScreen.xib */,
102 | 637DDE861AF3EEF600687C6A /* Supporting Files */,
103 | );
104 | path = JsWebView;
105 | sourceTree = "";
106 | };
107 | 637DDE861AF3EEF600687C6A /* Supporting Files */ = {
108 | isa = PBXGroup;
109 | children = (
110 | 637DDE871AF3EEF600687C6A /* Info.plist */,
111 | 637DDE881AF3EEF600687C6A /* main.m */,
112 | );
113 | name = "Supporting Files";
114 | sourceTree = "";
115 | };
116 | 637DDE9F1AF3EEF600687C6A /* JsWebViewTests */ = {
117 | isa = PBXGroup;
118 | children = (
119 | 637DDEA21AF3EEF600687C6A /* JsWebViewTests.m */,
120 | 637DDEA01AF3EEF600687C6A /* Supporting Files */,
121 | );
122 | path = JsWebViewTests;
123 | sourceTree = "";
124 | };
125 | 637DDEA01AF3EEF600687C6A /* Supporting Files */ = {
126 | isa = PBXGroup;
127 | children = (
128 | 637DDEA11AF3EEF600687C6A /* Info.plist */,
129 | );
130 | name = "Supporting Files";
131 | sourceTree = "";
132 | };
133 | /* End PBXGroup section */
134 |
135 | /* Begin PBXNativeTarget section */
136 | 637DDE821AF3EEF600687C6A /* JsWebView */ = {
137 | isa = PBXNativeTarget;
138 | buildConfigurationList = 637DDEA61AF3EEF600687C6A /* Build configuration list for PBXNativeTarget "JsWebView" */;
139 | buildPhases = (
140 | 637DDE7F1AF3EEF600687C6A /* Sources */,
141 | 637DDE801AF3EEF600687C6A /* Frameworks */,
142 | 637DDE811AF3EEF600687C6A /* Resources */,
143 | );
144 | buildRules = (
145 | );
146 | dependencies = (
147 | );
148 | name = JsWebView;
149 | productName = JsWebView;
150 | productReference = 637DDE831AF3EEF600687C6A /* JsWebView.app */;
151 | productType = "com.apple.product-type.application";
152 | };
153 | 637DDE9B1AF3EEF600687C6A /* JsWebViewTests */ = {
154 | isa = PBXNativeTarget;
155 | buildConfigurationList = 637DDEA91AF3EEF600687C6A /* Build configuration list for PBXNativeTarget "JsWebViewTests" */;
156 | buildPhases = (
157 | 637DDE981AF3EEF600687C6A /* Sources */,
158 | 637DDE991AF3EEF600687C6A /* Frameworks */,
159 | 637DDE9A1AF3EEF600687C6A /* Resources */,
160 | );
161 | buildRules = (
162 | );
163 | dependencies = (
164 | 637DDE9E1AF3EEF600687C6A /* PBXTargetDependency */,
165 | );
166 | name = JsWebViewTests;
167 | productName = JsWebViewTests;
168 | productReference = 637DDE9C1AF3EEF600687C6A /* JsWebViewTests.xctest */;
169 | productType = "com.apple.product-type.bundle.unit-test";
170 | };
171 | /* End PBXNativeTarget section */
172 |
173 | /* Begin PBXProject section */
174 | 637DDE7B1AF3EEF600687C6A /* Project object */ = {
175 | isa = PBXProject;
176 | attributes = {
177 | LastUpgradeCheck = 0630;
178 | ORGANIZATIONNAME = xdf;
179 | TargetAttributes = {
180 | 637DDE821AF3EEF600687C6A = {
181 | CreatedOnToolsVersion = 6.3.1;
182 | };
183 | 637DDE9B1AF3EEF600687C6A = {
184 | CreatedOnToolsVersion = 6.3.1;
185 | TestTargetID = 637DDE821AF3EEF600687C6A;
186 | };
187 | };
188 | };
189 | buildConfigurationList = 637DDE7E1AF3EEF600687C6A /* Build configuration list for PBXProject "JsWebView" */;
190 | compatibilityVersion = "Xcode 3.2";
191 | developmentRegion = English;
192 | hasScannedForEncodings = 0;
193 | knownRegions = (
194 | en,
195 | Base,
196 | );
197 | mainGroup = 637DDE7A1AF3EEF600687C6A;
198 | productRefGroup = 637DDE841AF3EEF600687C6A /* Products */;
199 | projectDirPath = "";
200 | projectRoot = "";
201 | targets = (
202 | 637DDE821AF3EEF600687C6A /* JsWebView */,
203 | 637DDE9B1AF3EEF600687C6A /* JsWebViewTests */,
204 | );
205 | };
206 | /* End PBXProject section */
207 |
208 | /* Begin PBXResourcesBuildPhase section */
209 | 637DDE811AF3EEF600687C6A /* Resources */ = {
210 | isa = PBXResourcesBuildPhase;
211 | buildActionMask = 2147483647;
212 | files = (
213 | 637DDEB41AF3F3C600687C6A /* index.html in Resources */,
214 | 637DDEB21AF3F0AB00687C6A /* JSBridge.js in Resources */,
215 | 637DDE921AF3EEF600687C6A /* Main.storyboard in Resources */,
216 | 637DDE971AF3EEF600687C6A /* LaunchScreen.xib in Resources */,
217 | 637DDE941AF3EEF600687C6A /* Images.xcassets in Resources */,
218 | );
219 | runOnlyForDeploymentPostprocessing = 0;
220 | };
221 | 637DDE9A1AF3EEF600687C6A /* Resources */ = {
222 | isa = PBXResourcesBuildPhase;
223 | buildActionMask = 2147483647;
224 | files = (
225 | );
226 | runOnlyForDeploymentPostprocessing = 0;
227 | };
228 | /* End PBXResourcesBuildPhase section */
229 |
230 | /* Begin PBXSourcesBuildPhase section */
231 | 637DDE7F1AF3EEF600687C6A /* Sources */ = {
232 | isa = PBXSourcesBuildPhase;
233 | buildActionMask = 2147483647;
234 | files = (
235 | 637DDE8F1AF3EEF600687C6A /* ViewController.m in Sources */,
236 | 637DDE8C1AF3EEF600687C6A /* AppDelegate.m in Sources */,
237 | 637DDEB11AF3F0AB00687C6A /* JsWebViewController.m in Sources */,
238 | 637DDE891AF3EEF600687C6A /* main.m in Sources */,
239 | );
240 | runOnlyForDeploymentPostprocessing = 0;
241 | };
242 | 637DDE981AF3EEF600687C6A /* Sources */ = {
243 | isa = PBXSourcesBuildPhase;
244 | buildActionMask = 2147483647;
245 | files = (
246 | 637DDEA31AF3EEF600687C6A /* JsWebViewTests.m in Sources */,
247 | );
248 | runOnlyForDeploymentPostprocessing = 0;
249 | };
250 | /* End PBXSourcesBuildPhase section */
251 |
252 | /* Begin PBXTargetDependency section */
253 | 637DDE9E1AF3EEF600687C6A /* PBXTargetDependency */ = {
254 | isa = PBXTargetDependency;
255 | target = 637DDE821AF3EEF600687C6A /* JsWebView */;
256 | targetProxy = 637DDE9D1AF3EEF600687C6A /* PBXContainerItemProxy */;
257 | };
258 | /* End PBXTargetDependency section */
259 |
260 | /* Begin PBXVariantGroup section */
261 | 637DDE901AF3EEF600687C6A /* Main.storyboard */ = {
262 | isa = PBXVariantGroup;
263 | children = (
264 | 637DDE911AF3EEF600687C6A /* Base */,
265 | );
266 | name = Main.storyboard;
267 | sourceTree = "";
268 | };
269 | 637DDE951AF3EEF600687C6A /* LaunchScreen.xib */ = {
270 | isa = PBXVariantGroup;
271 | children = (
272 | 637DDE961AF3EEF600687C6A /* Base */,
273 | );
274 | name = LaunchScreen.xib;
275 | sourceTree = "";
276 | };
277 | /* End PBXVariantGroup section */
278 |
279 | /* Begin XCBuildConfiguration section */
280 | 637DDEA41AF3EEF600687C6A /* Debug */ = {
281 | isa = XCBuildConfiguration;
282 | buildSettings = {
283 | ALWAYS_SEARCH_USER_PATHS = NO;
284 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
285 | CLANG_CXX_LIBRARY = "libc++";
286 | CLANG_ENABLE_MODULES = YES;
287 | CLANG_ENABLE_OBJC_ARC = YES;
288 | CLANG_WARN_BOOL_CONVERSION = YES;
289 | CLANG_WARN_CONSTANT_CONVERSION = YES;
290 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
291 | CLANG_WARN_EMPTY_BODY = YES;
292 | CLANG_WARN_ENUM_CONVERSION = YES;
293 | CLANG_WARN_INT_CONVERSION = YES;
294 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
295 | CLANG_WARN_UNREACHABLE_CODE = YES;
296 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
297 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
298 | COPY_PHASE_STRIP = NO;
299 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
300 | ENABLE_STRICT_OBJC_MSGSEND = YES;
301 | GCC_C_LANGUAGE_STANDARD = gnu99;
302 | GCC_DYNAMIC_NO_PIC = NO;
303 | GCC_NO_COMMON_BLOCKS = YES;
304 | GCC_OPTIMIZATION_LEVEL = 0;
305 | GCC_PREPROCESSOR_DEFINITIONS = (
306 | "DEBUG=1",
307 | "$(inherited)",
308 | );
309 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
312 | GCC_WARN_UNDECLARED_SELECTOR = YES;
313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
314 | GCC_WARN_UNUSED_FUNCTION = YES;
315 | GCC_WARN_UNUSED_VARIABLE = YES;
316 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
317 | MTL_ENABLE_DEBUG_INFO = YES;
318 | ONLY_ACTIVE_ARCH = YES;
319 | SDKROOT = iphoneos;
320 | };
321 | name = Debug;
322 | };
323 | 637DDEA51AF3EEF600687C6A /* Release */ = {
324 | isa = XCBuildConfiguration;
325 | buildSettings = {
326 | ALWAYS_SEARCH_USER_PATHS = NO;
327 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
328 | CLANG_CXX_LIBRARY = "libc++";
329 | CLANG_ENABLE_MODULES = YES;
330 | CLANG_ENABLE_OBJC_ARC = YES;
331 | CLANG_WARN_BOOL_CONVERSION = YES;
332 | CLANG_WARN_CONSTANT_CONVERSION = YES;
333 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
334 | CLANG_WARN_EMPTY_BODY = YES;
335 | CLANG_WARN_ENUM_CONVERSION = YES;
336 | CLANG_WARN_INT_CONVERSION = YES;
337 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
338 | CLANG_WARN_UNREACHABLE_CODE = YES;
339 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
340 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
341 | COPY_PHASE_STRIP = NO;
342 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
343 | ENABLE_NS_ASSERTIONS = NO;
344 | ENABLE_STRICT_OBJC_MSGSEND = YES;
345 | GCC_C_LANGUAGE_STANDARD = gnu99;
346 | GCC_NO_COMMON_BLOCKS = YES;
347 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
348 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
349 | GCC_WARN_UNDECLARED_SELECTOR = YES;
350 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
351 | GCC_WARN_UNUSED_FUNCTION = YES;
352 | GCC_WARN_UNUSED_VARIABLE = YES;
353 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
354 | MTL_ENABLE_DEBUG_INFO = NO;
355 | SDKROOT = iphoneos;
356 | VALIDATE_PRODUCT = YES;
357 | };
358 | name = Release;
359 | };
360 | 637DDEA71AF3EEF600687C6A /* Debug */ = {
361 | isa = XCBuildConfiguration;
362 | buildSettings = {
363 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
364 | INFOPLIST_FILE = JsWebView/Info.plist;
365 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
366 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
367 | PRODUCT_NAME = "$(TARGET_NAME)";
368 | };
369 | name = Debug;
370 | };
371 | 637DDEA81AF3EEF600687C6A /* Release */ = {
372 | isa = XCBuildConfiguration;
373 | buildSettings = {
374 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
375 | INFOPLIST_FILE = JsWebView/Info.plist;
376 | IPHONEOS_DEPLOYMENT_TARGET = 6.0;
377 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
378 | PRODUCT_NAME = "$(TARGET_NAME)";
379 | };
380 | name = Release;
381 | };
382 | 637DDEAA1AF3EEF600687C6A /* Debug */ = {
383 | isa = XCBuildConfiguration;
384 | buildSettings = {
385 | BUNDLE_LOADER = "$(TEST_HOST)";
386 | FRAMEWORK_SEARCH_PATHS = (
387 | "$(SDKROOT)/Developer/Library/Frameworks",
388 | "$(inherited)",
389 | );
390 | GCC_PREPROCESSOR_DEFINITIONS = (
391 | "DEBUG=1",
392 | "$(inherited)",
393 | );
394 | INFOPLIST_FILE = JsWebViewTests/Info.plist;
395 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
396 | PRODUCT_NAME = "$(TARGET_NAME)";
397 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JsWebView.app/JsWebView";
398 | };
399 | name = Debug;
400 | };
401 | 637DDEAB1AF3EEF600687C6A /* Release */ = {
402 | isa = XCBuildConfiguration;
403 | buildSettings = {
404 | BUNDLE_LOADER = "$(TEST_HOST)";
405 | FRAMEWORK_SEARCH_PATHS = (
406 | "$(SDKROOT)/Developer/Library/Frameworks",
407 | "$(inherited)",
408 | );
409 | INFOPLIST_FILE = JsWebViewTests/Info.plist;
410 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
411 | PRODUCT_NAME = "$(TARGET_NAME)";
412 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JsWebView.app/JsWebView";
413 | };
414 | name = Release;
415 | };
416 | /* End XCBuildConfiguration section */
417 |
418 | /* Begin XCConfigurationList section */
419 | 637DDE7E1AF3EEF600687C6A /* Build configuration list for PBXProject "JsWebView" */ = {
420 | isa = XCConfigurationList;
421 | buildConfigurations = (
422 | 637DDEA41AF3EEF600687C6A /* Debug */,
423 | 637DDEA51AF3EEF600687C6A /* Release */,
424 | );
425 | defaultConfigurationIsVisible = 0;
426 | defaultConfigurationName = Release;
427 | };
428 | 637DDEA61AF3EEF600687C6A /* Build configuration list for PBXNativeTarget "JsWebView" */ = {
429 | isa = XCConfigurationList;
430 | buildConfigurations = (
431 | 637DDEA71AF3EEF600687C6A /* Debug */,
432 | 637DDEA81AF3EEF600687C6A /* Release */,
433 | );
434 | defaultConfigurationIsVisible = 0;
435 | };
436 | 637DDEA91AF3EEF600687C6A /* Build configuration list for PBXNativeTarget "JsWebViewTests" */ = {
437 | isa = XCConfigurationList;
438 | buildConfigurations = (
439 | 637DDEAA1AF3EEF600687C6A /* Debug */,
440 | 637DDEAB1AF3EEF600687C6A /* Release */,
441 | );
442 | defaultConfigurationIsVisible = 0;
443 | };
444 | /* End XCConfigurationList section */
445 | };
446 | rootObject = 637DDE7B1AF3EEF600687C6A /* Project object */;
447 | }
448 |
--------------------------------------------------------------------------------