Skip to content

Commit d3308b7

Browse files
committed
add demo and demo logic
1 parent a5d46b6 commit d3308b7

8 files changed

Lines changed: 476 additions & 0 deletions

File tree

WKWebViewJavascriptBridge.xcodeproj/project.pbxproj

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
BC4A38AE20138F7500E96E5D /* WKWebViewJavascriptBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC4A38A420138F7500E96E5D /* WKWebViewJavascriptBridge.framework */; };
1414
BC4A38B320138F7500E96E5D /* WKWebViewJavascriptBridgeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC4A38B220138F7500E96E5D /* WKWebViewJavascriptBridgeTests.swift */; };
1515
BC4A38B520138F7500E96E5D /* WKWebViewJavascriptBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4A38A720138F7500E96E5D /* WKWebViewJavascriptBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
16+
BC942673201750BA00A5A6F9 /* WKWebViewJavascriptBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC4A38A420138F7500E96E5D /* WKWebViewJavascriptBridge.framework */; };
17+
BC995A492016F5690012F728 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC995A482016F5690012F728 /* AppDelegate.swift */; };
18+
BC995A4B2016F5690012F728 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC995A4A2016F5690012F728 /* ViewController.swift */; };
19+
BC995A4E2016F5690012F728 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BC995A4C2016F5690012F728 /* Main.storyboard */; };
20+
BC995A502016F5690012F728 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BC995A4F2016F5690012F728 /* Assets.xcassets */; };
21+
BC995A532016F5690012F728 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BC995A512016F5690012F728 /* LaunchScreen.storyboard */; };
1622
/* End PBXBuildFile section */
1723

1824
/* Begin PBXContainerItemProxy section */
@@ -35,6 +41,14 @@
3541
BC4A38AD20138F7500E96E5D /* WKWebViewJavascriptBridgeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WKWebViewJavascriptBridgeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3642
BC4A38B220138F7500E96E5D /* WKWebViewJavascriptBridgeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WKWebViewJavascriptBridgeTests.swift; sourceTree = "<group>"; };
3743
BC4A38B420138F7500E96E5D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
44+
BC995A462016F5690012F728 /* WKWebViewJavascriptBridgeDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WKWebViewJavascriptBridgeDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
45+
BC995A482016F5690012F728 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
46+
BC995A4A2016F5690012F728 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
47+
BC995A4D2016F5690012F728 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
48+
BC995A4F2016F5690012F728 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
49+
BC995A522016F5690012F728 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
50+
BC995A542016F5690012F728 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
51+
BC995A582016F6A60012F728 /* Demo.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = Demo.html; sourceTree = "<group>"; };
3852
/* End PBXFileReference section */
3953

4054
/* Begin PBXFrameworksBuildPhase section */
@@ -53,6 +67,14 @@
5367
);
5468
runOnlyForDeploymentPostprocessing = 0;
5569
};
70+
BC995A432016F5690012F728 /* Frameworks */ = {
71+
isa = PBXFrameworksBuildPhase;
72+
buildActionMask = 2147483647;
73+
files = (
74+
BC942673201750BA00A5A6F9 /* WKWebViewJavascriptBridge.framework in Frameworks */,
75+
);
76+
runOnlyForDeploymentPostprocessing = 0;
77+
};
5678
/* End PBXFrameworksBuildPhase section */
5779

5880
/* Begin PBXGroup section */
@@ -61,7 +83,9 @@
6183
children = (
6284
BC4A38A620138F7500E96E5D /* WKWebViewJavascriptBridge */,
6385
BC4A38B120138F7500E96E5D /* WKWebViewJavascriptBridgeTests */,
86+
BC995A472016F5690012F728 /* WKWebViewJavascriptBridgeDemo */,
6487
BC4A38A520138F7500E96E5D /* Products */,
88+
BC942672201750BA00A5A6F9 /* Frameworks */,
6589
);
6690
sourceTree = "<group>";
6791
};
@@ -70,6 +94,7 @@
7094
children = (
7195
BC4A38A420138F7500E96E5D /* WKWebViewJavascriptBridge.framework */,
7296
BC4A38AD20138F7500E96E5D /* WKWebViewJavascriptBridgeTests.xctest */,
97+
BC995A462016F5690012F728 /* WKWebViewJavascriptBridgeDemo.app */,
7398
);
7499
name = Products;
75100
sourceTree = "<group>";
@@ -95,6 +120,27 @@
95120
path = WKWebViewJavascriptBridgeTests;
96121
sourceTree = "<group>";
97122
};
123+
BC942672201750BA00A5A6F9 /* Frameworks */ = {
124+
isa = PBXGroup;
125+
children = (
126+
);
127+
name = Frameworks;
128+
sourceTree = "<group>";
129+
};
130+
BC995A472016F5690012F728 /* WKWebViewJavascriptBridgeDemo */ = {
131+
isa = PBXGroup;
132+
children = (
133+
BC995A582016F6A60012F728 /* Demo.html */,
134+
BC995A482016F5690012F728 /* AppDelegate.swift */,
135+
BC995A4A2016F5690012F728 /* ViewController.swift */,
136+
BC995A4C2016F5690012F728 /* Main.storyboard */,
137+
BC995A4F2016F5690012F728 /* Assets.xcassets */,
138+
BC995A512016F5690012F728 /* LaunchScreen.storyboard */,
139+
BC995A542016F5690012F728 /* Info.plist */,
140+
);
141+
path = WKWebViewJavascriptBridgeDemo;
142+
sourceTree = "<group>";
143+
};
98144
/* End PBXGroup section */
99145

100146
/* Begin PBXHeadersBuildPhase section */
@@ -145,6 +191,23 @@
145191
productReference = BC4A38AD20138F7500E96E5D /* WKWebViewJavascriptBridgeTests.xctest */;
146192
productType = "com.apple.product-type.bundle.unit-test";
147193
};
194+
BC995A452016F5690012F728 /* WKWebViewJavascriptBridgeDemo */ = {
195+
isa = PBXNativeTarget;
196+
buildConfigurationList = BC995A572016F5690012F728 /* Build configuration list for PBXNativeTarget "WKWebViewJavascriptBridgeDemo" */;
197+
buildPhases = (
198+
BC995A422016F5690012F728 /* Sources */,
199+
BC995A432016F5690012F728 /* Frameworks */,
200+
BC995A442016F5690012F728 /* Resources */,
201+
);
202+
buildRules = (
203+
);
204+
dependencies = (
205+
);
206+
name = WKWebViewJavascriptBridgeDemo;
207+
productName = WKWebViewJavascriptBridgeDemo;
208+
productReference = BC995A462016F5690012F728 /* WKWebViewJavascriptBridgeDemo.app */;
209+
productType = "com.apple.product-type.application";
210+
};
148211
/* End PBXNativeTarget section */
149212

150213
/* Begin PBXProject section */
@@ -164,6 +227,10 @@
164227
CreatedOnToolsVersion = 9.0;
165228
ProvisioningStyle = Automatic;
166229
};
230+
BC995A452016F5690012F728 = {
231+
CreatedOnToolsVersion = 9.0;
232+
ProvisioningStyle = Automatic;
233+
};
167234
};
168235
};
169236
buildConfigurationList = BC4A389E20138F7500E96E5D /* Build configuration list for PBXProject "WKWebViewJavascriptBridge" */;
@@ -172,6 +239,7 @@
172239
hasScannedForEncodings = 0;
173240
knownRegions = (
174241
en,
242+
Base,
175243
);
176244
mainGroup = BC4A389A20138F7500E96E5D;
177245
productRefGroup = BC4A38A520138F7500E96E5D /* Products */;
@@ -180,6 +248,7 @@
180248
targets = (
181249
BC4A38A320138F7500E96E5D /* WKWebViewJavascriptBridge */,
182250
BC4A38AC20138F7500E96E5D /* WKWebViewJavascriptBridgeTests */,
251+
BC995A452016F5690012F728 /* WKWebViewJavascriptBridgeDemo */,
183252
);
184253
};
185254
/* End PBXProject section */
@@ -199,6 +268,16 @@
199268
);
200269
runOnlyForDeploymentPostprocessing = 0;
201270
};
271+
BC995A442016F5690012F728 /* Resources */ = {
272+
isa = PBXResourcesBuildPhase;
273+
buildActionMask = 2147483647;
274+
files = (
275+
BC995A532016F5690012F728 /* LaunchScreen.storyboard in Resources */,
276+
BC995A502016F5690012F728 /* Assets.xcassets in Resources */,
277+
BC995A4E2016F5690012F728 /* Main.storyboard in Resources */,
278+
);
279+
runOnlyForDeploymentPostprocessing = 0;
280+
};
202281
/* End PBXResourcesBuildPhase section */
203282

204283
/* Begin PBXSourcesBuildPhase section */
@@ -220,6 +299,15 @@
220299
);
221300
runOnlyForDeploymentPostprocessing = 0;
222301
};
302+
BC995A422016F5690012F728 /* Sources */ = {
303+
isa = PBXSourcesBuildPhase;
304+
buildActionMask = 2147483647;
305+
files = (
306+
BC995A4B2016F5690012F728 /* ViewController.swift in Sources */,
307+
BC995A492016F5690012F728 /* AppDelegate.swift in Sources */,
308+
);
309+
runOnlyForDeploymentPostprocessing = 0;
310+
};
223311
/* End PBXSourcesBuildPhase section */
224312

225313
/* Begin PBXTargetDependency section */
@@ -230,6 +318,25 @@
230318
};
231319
/* End PBXTargetDependency section */
232320

321+
/* Begin PBXVariantGroup section */
322+
BC995A4C2016F5690012F728 /* Main.storyboard */ = {
323+
isa = PBXVariantGroup;
324+
children = (
325+
BC995A4D2016F5690012F728 /* Base */,
326+
);
327+
name = Main.storyboard;
328+
sourceTree = "<group>";
329+
};
330+
BC995A512016F5690012F728 /* LaunchScreen.storyboard */ = {
331+
isa = PBXVariantGroup;
332+
children = (
333+
BC995A522016F5690012F728 /* Base */,
334+
);
335+
name = LaunchScreen.storyboard;
336+
sourceTree = "<group>";
337+
};
338+
/* End PBXVariantGroup section */
339+
233340
/* Begin XCBuildConfiguration section */
234341
BC4A38B620138F7500E96E5D /* Debug */ = {
235342
isa = XCBuildConfiguration;
@@ -421,6 +528,38 @@
421528
};
422529
name = Release;
423530
};
531+
BC995A552016F5690012F728 /* Debug */ = {
532+
isa = XCBuildConfiguration;
533+
buildSettings = {
534+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
535+
CODE_SIGN_STYLE = Automatic;
536+
DEVELOPMENT_TEAM = ACXP2JHJKF;
537+
INFOPLIST_FILE = WKWebViewJavascriptBridgeDemo/Info.plist;
538+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
539+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
540+
PRODUCT_BUNDLE_IDENTIFIER = com.Lision.WKWebViewJavascriptBridgeDemo;
541+
PRODUCT_NAME = "$(TARGET_NAME)";
542+
SWIFT_VERSION = 4.0;
543+
TARGETED_DEVICE_FAMILY = "1,2";
544+
};
545+
name = Debug;
546+
};
547+
BC995A562016F5690012F728 /* Release */ = {
548+
isa = XCBuildConfiguration;
549+
buildSettings = {
550+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
551+
CODE_SIGN_STYLE = Automatic;
552+
DEVELOPMENT_TEAM = ACXP2JHJKF;
553+
INFOPLIST_FILE = WKWebViewJavascriptBridgeDemo/Info.plist;
554+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
555+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
556+
PRODUCT_BUNDLE_IDENTIFIER = com.Lision.WKWebViewJavascriptBridgeDemo;
557+
PRODUCT_NAME = "$(TARGET_NAME)";
558+
SWIFT_VERSION = 4.0;
559+
TARGETED_DEVICE_FAMILY = "1,2";
560+
};
561+
name = Release;
562+
};
424563
/* End XCBuildConfiguration section */
425564

426565
/* Begin XCConfigurationList section */
@@ -451,6 +590,15 @@
451590
defaultConfigurationIsVisible = 0;
452591
defaultConfigurationName = Release;
453592
};
593+
BC995A572016F5690012F728 /* Build configuration list for PBXNativeTarget "WKWebViewJavascriptBridgeDemo" */ = {
594+
isa = XCConfigurationList;
595+
buildConfigurations = (
596+
BC995A552016F5690012F728 /* Debug */,
597+
BC995A562016F5690012F728 /* Release */,
598+
);
599+
defaultConfigurationIsVisible = 0;
600+
defaultConfigurationName = Release;
601+
};
454602
/* End XCConfigurationList section */
455603
};
456604
rootObject = BC4A389B20138F7500E96E5D /* Project object */;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//
2+
// AppDelegate.swift
3+
// WKWebViewJavascriptBridgeDemo
4+
//
5+
// Created by Lision on 2018/1/23.
6+
// Copyright © 2018年 Lision. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
@UIApplicationMain
12+
class AppDelegate: UIResponder, UIApplicationDelegate {
13+
14+
var window: UIWindow?
15+
16+
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18+
// Override point for customization after application launch.
19+
return true
20+
}
21+
22+
func applicationWillResignActive(_ application: UIApplication) {
23+
// 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.
24+
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25+
}
26+
27+
func applicationDidEnterBackground(_ application: UIApplication) {
28+
// 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.
29+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30+
}
31+
32+
func applicationWillEnterForeground(_ application: UIApplication) {
33+
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34+
}
35+
36+
func applicationDidBecomeActive(_ application: UIApplication) {
37+
// 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.
38+
}
39+
40+
func applicationWillTerminate(_ application: UIApplication) {
41+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42+
}
43+
44+
45+
}
46+
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "20x20",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "20x20",
11+
"scale" : "3x"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"size" : "29x29",
16+
"scale" : "2x"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "29x29",
21+
"scale" : "3x"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"size" : "40x40",
26+
"scale" : "2x"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"size" : "40x40",
31+
"scale" : "3x"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"size" : "60x60",
36+
"scale" : "2x"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"size" : "60x60",
41+
"scale" : "3x"
42+
},
43+
{
44+
"idiom" : "ipad",
45+
"size" : "20x20",
46+
"scale" : "1x"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"size" : "20x20",
51+
"scale" : "2x"
52+
},
53+
{
54+
"idiom" : "ipad",
55+
"size" : "29x29",
56+
"scale" : "1x"
57+
},
58+
{
59+
"idiom" : "ipad",
60+
"size" : "29x29",
61+
"scale" : "2x"
62+
},
63+
{
64+
"idiom" : "ipad",
65+
"size" : "40x40",
66+
"scale" : "1x"
67+
},
68+
{
69+
"idiom" : "ipad",
70+
"size" : "40x40",
71+
"scale" : "2x"
72+
},
73+
{
74+
"idiom" : "ipad",
75+
"size" : "76x76",
76+
"scale" : "1x"
77+
},
78+
{
79+
"idiom" : "ipad",
80+
"size" : "76x76",
81+
"scale" : "2x"
82+
},
83+
{
84+
"idiom" : "ipad",
85+
"size" : "83.5x83.5",
86+
"scale" : "2x"
87+
}
88+
],
89+
"info" : {
90+
"version" : 1,
91+
"author" : "xcode"
92+
}
93+
}

0 commit comments

Comments
 (0)