[fix]some ignore
This commit is contained in:
commit
3cc42ec6f1
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
# Mac OS X
|
||||
*.DS_Store
|
||||
|
||||
# Xcode
|
||||
*.pbxuser
|
||||
*.mode1v3
|
||||
*.mode2v3
|
||||
*.perspectivev3
|
||||
*.xcuserstate
|
||||
*.xcworkspace/
|
||||
xcuserdata/
|
106
Changelog
Normal file
106
Changelog
Normal file
@ -0,0 +1,106 @@
|
||||
WebViewJavascriptBridge Changelog
|
||||
=================================
|
||||
|
||||
Release Checklist
|
||||
-----------------
|
||||
- gitu-update
|
||||
- Note Changelog
|
||||
- Bump `WebViewJavascriptBridge.podspec` version "X.Y.Z"
|
||||
- gitm-commit "vX.Y.Z"
|
||||
- gitt-tag "vX.Y.Z"
|
||||
- pod trunk push
|
||||
|
||||
Version History
|
||||
---------------
|
||||
|
||||
v5.1.1
|
||||
+ Swift unit tests and examples
|
||||
+ Implement removeHandler
|
||||
|
||||
v5.1.0
|
||||
+ A single instantiation function for all webview types.
|
||||
+ Improved test runner.
|
||||
+ New instructions & templates for github issues and pull requests.
|
||||
|
||||
v5.0.5
|
||||
+ Run all tests for both UIWebView and WKWebView webviews/bridges.
|
||||
+ Allow for calling handlers from JS with just a handler name and responseCallback function (#184).
|
||||
|
||||
v5.0.3 & v5.0.4
|
||||
+ Recalled builds :)
|
||||
|
||||
v5.0.2
|
||||
+ Fix bug that could cause a crash if the webview loads a new page immediately after JS sends a message.
|
||||
|
||||
v5.0.1
|
||||
+ Removed `WebViewJavascriptBridge -reset`. It should never have been exposed as a public API.
|
||||
+ Fixed compilation in C99 mode
|
||||
+ Inline JS source code. WVJB no longer requires `WebViewJavascriptBridge.js.txt` to be included as a resource.
|
||||
+ Automated testing: see `make test`
|
||||
+ Added Makefile with common commands
|
||||
+ Significantly simplified and improved wvjb load detection
|
||||
+ Simplify API by focusing on explicitly named handlers instead of a default handler and plain `send`.
|
||||
|
||||
v4.1.4
|
||||
+ Improve how WVJB handles the case when there is no ObjC handler for a message received from js.
|
||||
+ If an objc handler throws and exception, let it bubble up to the webkit engine instead of catching it in WVJB.
|
||||
|
||||
v4.1.3
|
||||
+ Update podspec file with tag
|
||||
|
||||
v4.1.2
|
||||
+ Fix bug: webViewDidStart/FinishLoad were called twice and isLoading was always true (#86)
|
||||
|
||||
v4.1.1
|
||||
+ Better JS initialization script (thank @refractalize!)
|
||||
+ When passing nil to an objc response callback, replace it with [NSNull null] (becomes null in js)
|
||||
|
||||
v4.1.0
|
||||
+ Allow for sending null/nil data packets
|
||||
+ Drop support for JSONKit
|
||||
+ Clean up internal represenation of messages
|
||||
|
||||
v4.0.2
|
||||
+ Fix NSInvalidArgumentException: "attempt to insert nil object" when using shorthand -callHandler:
|
||||
+ Fix sending messages including __WVJB_MESSAGE_SEPERATOR__ string
|
||||
|
||||
v4.0.1
|
||||
+ Fix detection of arc_weak support
|
||||
|
||||
v4.0.0
|
||||
+ Consolidate platform-specific code into a single WebViewJavascriptBridge.m/h using macros (57ee322a4c5310eadd28b28f4d8522cd54123301)
|
||||
+ Bugfix: Don't make navigation decisions for webviews we don't control (254ea00267f8c1e03727885f4e1e0fd5f5c78be8)
|
||||
|
||||
v3.1.0
|
||||
+ Dont inject the WVJB bridge until all requests have finished loading (61b853)
|
||||
+ Add podspec file (818d49cfc)
|
||||
+ Memory leaks fixed (b06988f1, 20ce1b0b)
|
||||
+ New major contributor @peyton!
|
||||
|
||||
v3.0.0
|
||||
+ OSX Support
|
||||
+ New major contributor @oakho!
|
||||
|
||||
v2.1.2
|
||||
+ Copy handler and response blocks
|
||||
|
||||
v2.1.1
|
||||
+ Handle edge cases gracefully (e.g. don't crash on unknown command or unexpected response)
|
||||
|
||||
v2.1.0
|
||||
+ Remove WVJBResponse object and the notion of responding with an error. See 4ab41bb4d7.
|
||||
|
||||
v2.0.0
|
||||
+ Messages are objects instead of strings. Supports NSDictionary*/Objects, NSArray*/Arrays, NSNumber*/Number & NSString*/String.
|
||||
+ Messages are encoded with NSJSONSerialization. Optional fallback to JSONKit for iOS 4 support.
|
||||
+ Messages can expect responses. A message received with an expected response is accompanied by a WVJBResponse* object.
|
||||
+ Handlers can be registered by name, and called with data and an optional expected response.
|
||||
+ Responses expect either an error or data (`-(void)respond:(id)data`, -(void)respondWithError:(id)error)
|
||||
|
||||
v0.0.1
|
||||
+ ObjC: A WebViewJavascriptBridge class (a UIWebViewDelegate) that enables message passing to and from the JS
|
||||
+ ObjC: A protocol called WebViewJavascriptBridgeDelegate that lets you handle messages received from the JS
|
||||
+ JS: Event when the bridge is ready - document.addEventListener('WebViewJavascriptBridgeReady', function() {}, false)
|
||||
+ JS: Ability to set your message handler - WebViewJavascriptBridge.setMessageHandler(function() {})
|
||||
+ JS: Function to send messages - WebViewJavascriptBridge.sendMessage('a message');
|
||||
+ All messages are strings. Use JSON in your js and e.g. JSONKit in iOS to send structured messages
|
363
Example Apps/ExampleApp-OSX.xcodeproj/project.pbxproj
Normal file
363
Example Apps/ExampleApp-OSX.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,363 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0ECB01491A0EEB3A0037FF4E /* WebViewJavascriptBridgeBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0ECB01461A0EEB3A0037FF4E /* WebViewJavascriptBridgeBase.m */; };
|
||||
0ECB014A1A0EEB3A0037FF4E /* WKWebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 0ECB01481A0EEB3A0037FF4E /* WKWebViewJavascriptBridge.m */; };
|
||||
2C136A2517641106004C7401 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C136A2417641106004C7401 /* Cocoa.framework */; };
|
||||
2C136A2F17641106004C7401 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2C136A2D17641106004C7401 /* InfoPlist.strings */; };
|
||||
2C136A3117641106004C7401 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C136A3017641106004C7401 /* main.m */; };
|
||||
2C136A3517641106004C7401 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2C136A3317641106004C7401 /* Credits.rtf */; };
|
||||
2C136A3817641106004C7401 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C136A3717641106004C7401 /* AppDelegate.m */; };
|
||||
2C136A4217641236004C7401 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C136A4117641236004C7401 /* WebKit.framework */; };
|
||||
2C136A5A17642704004C7401 /* ExampleApp.html in Resources */ = {isa = PBXBuildFile; fileRef = 2C136A5917642704004C7401 /* ExampleApp.html */; };
|
||||
2C1562C6176BA9FF00B4AE50 /* WebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C1562C4176BA9FF00B4AE50 /* WebViewJavascriptBridge.m */; };
|
||||
2C3E7C491C5A8B8D00A1E322 /* WebViewJavascriptBridge_JS.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C3E7C481C5A8B8D00A1E322 /* WebViewJavascriptBridge_JS.m */; };
|
||||
2CF17F5317D8AACF006E828B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2CF17F5217D8AACF006E828B /* MainMenu.xib */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0ECB01451A0EEB3A0037FF4E /* WebViewJavascriptBridgeBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridgeBase.h; sourceTree = "<group>"; };
|
||||
0ECB01461A0EEB3A0037FF4E /* WebViewJavascriptBridgeBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridgeBase.m; sourceTree = "<group>"; };
|
||||
0ECB01471A0EEB3A0037FF4E /* WKWebViewJavascriptBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewJavascriptBridge.h; sourceTree = "<group>"; };
|
||||
0ECB01481A0EEB3A0037FF4E /* WKWebViewJavascriptBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKWebViewJavascriptBridge.m; sourceTree = "<group>"; };
|
||||
2C136A2117641106004C7401 /* ExampleApp-OSX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ExampleApp-OSX.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2C136A2417641106004C7401 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
2C136A2717641106004C7401 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
2C136A2817641106004C7401 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
|
||||
2C136A2917641106004C7401 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
2C136A2C17641106004C7401 /* ExampleApp-OSX-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ExampleApp-OSX-Info.plist"; sourceTree = "<group>"; };
|
||||
2C136A2E17641106004C7401 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
2C136A3017641106004C7401 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
2C136A3217641106004C7401 /* ExampleApp-OSX-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ExampleApp-OSX-Prefix.pch"; sourceTree = "<group>"; };
|
||||
2C136A3417641106004C7401 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = "<group>"; };
|
||||
2C136A3617641106004C7401 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
2C136A3717641106004C7401 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
2C136A4117641236004C7401 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
|
||||
2C136A5917642704004C7401 /* ExampleApp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = ExampleApp.html; sourceTree = SOURCE_ROOT; };
|
||||
2C1562C2176BA9FF00B4AE50 /* WebViewJavascriptBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge.h; sourceTree = "<group>"; };
|
||||
2C1562C4176BA9FF00B4AE50 /* WebViewJavascriptBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge.m; sourceTree = "<group>"; };
|
||||
2C3E7C471C5A8B8D00A1E322 /* WebViewJavascriptBridge_JS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge_JS.h; sourceTree = "<group>"; };
|
||||
2C3E7C481C5A8B8D00A1E322 /* WebViewJavascriptBridge_JS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge_JS.m; sourceTree = "<group>"; };
|
||||
2CF17F5217D8AACF006E828B /* MainMenu.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2C136A1E17641106004C7401 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2C136A4217641236004C7401 /* WebKit.framework in Frameworks */,
|
||||
2C136A2517641106004C7401 /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2C136A1817641106004C7401 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2C136A4117641236004C7401 /* WebKit.framework */,
|
||||
2C136A2A17641106004C7401 /* ExampleApp-OSX */,
|
||||
2C136A2317641106004C7401 /* Frameworks */,
|
||||
2C136A2217641106004C7401 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2C136A2217641106004C7401 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2C136A2117641106004C7401 /* ExampleApp-OSX.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2C136A2317641106004C7401 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2C136A2417641106004C7401 /* Cocoa.framework */,
|
||||
2C136A2617641106004C7401 /* Other Frameworks */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2C136A2617641106004C7401 /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2C136A2717641106004C7401 /* AppKit.framework */,
|
||||
2C136A2817641106004C7401 /* CoreData.framework */,
|
||||
2C136A2917641106004C7401 /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2C136A2A17641106004C7401 /* ExampleApp-OSX */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2C136A3617641106004C7401 /* AppDelegate.h */,
|
||||
2C136A3717641106004C7401 /* AppDelegate.m */,
|
||||
2C136A5917642704004C7401 /* ExampleApp.html */,
|
||||
2CF17F5217D8AACF006E828B /* MainMenu.xib */,
|
||||
2C1562C1176BA9FF00B4AE50 /* WebViewJavascriptBridge */,
|
||||
2C136A2B17641106004C7401 /* Supporting Files */,
|
||||
);
|
||||
path = "ExampleApp-OSX";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2C136A2B17641106004C7401 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2C136A2C17641106004C7401 /* ExampleApp-OSX-Info.plist */,
|
||||
2C136A2D17641106004C7401 /* InfoPlist.strings */,
|
||||
2C136A3017641106004C7401 /* main.m */,
|
||||
2C136A3217641106004C7401 /* ExampleApp-OSX-Prefix.pch */,
|
||||
2C136A3317641106004C7401 /* Credits.rtf */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2C1562C1176BA9FF00B4AE50 /* WebViewJavascriptBridge */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2C3E7C471C5A8B8D00A1E322 /* WebViewJavascriptBridge_JS.h */,
|
||||
2C3E7C481C5A8B8D00A1E322 /* WebViewJavascriptBridge_JS.m */,
|
||||
0ECB01451A0EEB3A0037FF4E /* WebViewJavascriptBridgeBase.h */,
|
||||
0ECB01461A0EEB3A0037FF4E /* WebViewJavascriptBridgeBase.m */,
|
||||
0ECB01471A0EEB3A0037FF4E /* WKWebViewJavascriptBridge.h */,
|
||||
0ECB01481A0EEB3A0037FF4E /* WKWebViewJavascriptBridge.m */,
|
||||
2C1562C2176BA9FF00B4AE50 /* WebViewJavascriptBridge.h */,
|
||||
2C1562C4176BA9FF00B4AE50 /* WebViewJavascriptBridge.m */,
|
||||
);
|
||||
name = WebViewJavascriptBridge;
|
||||
path = ../../WebViewJavascriptBridge;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2C136A2017641106004C7401 /* ExampleApp-OSX */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2C136A3E17641106004C7401 /* Build configuration list for PBXNativeTarget "ExampleApp-OSX" */;
|
||||
buildPhases = (
|
||||
2C136A1D17641106004C7401 /* Sources */,
|
||||
2C136A1E17641106004C7401 /* Frameworks */,
|
||||
2C136A1F17641106004C7401 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "ExampleApp-OSX";
|
||||
productName = "ExampleApp-OSX";
|
||||
productReference = 2C136A2117641106004C7401 /* ExampleApp-OSX.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
2C136A1917641106004C7401 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0810;
|
||||
ORGANIZATIONNAME = "Marcus Westin";
|
||||
};
|
||||
buildConfigurationList = 2C136A1C17641106004C7401 /* Build configuration list for PBXProject "ExampleApp-OSX" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 2C136A1817641106004C7401;
|
||||
productRefGroup = 2C136A2217641106004C7401 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
2C136A2017641106004C7401 /* ExampleApp-OSX */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
2C136A1F17641106004C7401 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2C136A2F17641106004C7401 /* InfoPlist.strings in Resources */,
|
||||
2C136A3517641106004C7401 /* Credits.rtf in Resources */,
|
||||
2C136A5A17642704004C7401 /* ExampleApp.html in Resources */,
|
||||
2CF17F5317D8AACF006E828B /* MainMenu.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2C136A1D17641106004C7401 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
0ECB01491A0EEB3A0037FF4E /* WebViewJavascriptBridgeBase.m in Sources */,
|
||||
0ECB014A1A0EEB3A0037FF4E /* WKWebViewJavascriptBridge.m in Sources */,
|
||||
2C3E7C491C5A8B8D00A1E322 /* WebViewJavascriptBridge_JS.m in Sources */,
|
||||
2C136A3117641106004C7401 /* main.m in Sources */,
|
||||
2C1562C6176BA9FF00B4AE50 /* WebViewJavascriptBridge.m in Sources */,
|
||||
2C136A3817641106004C7401 /* AppDelegate.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
2C136A2D17641106004C7401 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
2C136A2E17641106004C7401 /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2C136A3317641106004C7401 /* Credits.rtf */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
2C136A3417641106004C7401 /* en */,
|
||||
);
|
||||
name = Credits.rtf;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2C136A3C17641106004C7401 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.8;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2C136A3D17641106004C7401 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.8;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
2C136A3F17641106004C7401 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "ExampleApp-OSX/ExampleApp-OSX-Prefix.pch";
|
||||
INFOPLIST_FILE = "ExampleApp-OSX/ExampleApp-OSX-Info.plist";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "WebViewJavascriptBridge.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2C136A4017641106004C7401 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "ExampleApp-OSX/ExampleApp-OSX-Prefix.pch";
|
||||
INFOPLIST_FILE = "ExampleApp-OSX/ExampleApp-OSX-Info.plist";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "WebViewJavascriptBridge.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2C136A1C17641106004C7401 /* Build configuration list for PBXProject "ExampleApp-OSX" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2C136A3C17641106004C7401 /* Debug */,
|
||||
2C136A3D17641106004C7401 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2C136A3E17641106004C7401 /* Build configuration list for PBXNativeTarget "ExampleApp-OSX" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2C136A3F17641106004C7401 /* Debug */,
|
||||
2C136A4017641106004C7401 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 2C136A1917641106004C7401 /* Project object */;
|
||||
}
|
15
Example Apps/ExampleApp-OSX/AppDelegate.h
Normal file
15
Example Apps/ExampleApp-OSX/AppDelegate.h
Normal file
@ -0,0 +1,15 @@
|
||||
//
|
||||
// AppDelegate.h
|
||||
// ExampleApp-OSX
|
||||
//
|
||||
// Created by Marcus Westin on 6/8/13.
|
||||
// Copyright (c) 2013 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||
|
||||
@property (assign) IBOutlet NSWindow *window;
|
||||
|
||||
@end
|
131
Example Apps/ExampleApp-OSX/AppDelegate.m
Normal file
131
Example Apps/ExampleApp-OSX/AppDelegate.m
Normal file
@ -0,0 +1,131 @@
|
||||
//
|
||||
// AppDelegate.m
|
||||
// ExampleApp-OSX
|
||||
//
|
||||
// Created by Marcus Westin on 6/8/13.
|
||||
// Copyright (c) 2013 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
#import "WebViewJavascriptBridge.h"
|
||||
|
||||
@implementation AppDelegate {
|
||||
WebView* _webView;
|
||||
WKWebView *_WKWebView;
|
||||
WebViewJavascriptBridge* _bridge;
|
||||
WebViewJavascriptBridge* _WKBridge;
|
||||
NSView* _WKWebViewWrapper;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
{
|
||||
[self _createViews];
|
||||
[self _configureWebview];
|
||||
[self _configureWKWebview];
|
||||
}
|
||||
|
||||
- (void)_configureWebview {
|
||||
// Create Bridge
|
||||
_bridge = [WebViewJavascriptBridge bridgeForWebView:_webView];
|
||||
|
||||
[_bridge registerHandler:@"testObjcCallback" handler:^(id data, WVJBResponseCallback responseCallback) {
|
||||
NSLog(@"testObjcCallback called: %@", data);
|
||||
responseCallback(@"Response from testObjcCallback");
|
||||
}];
|
||||
|
||||
[_bridge callHandler:@"testJavascriptHandler" data:@{ @"foo":@"before ready" }];
|
||||
|
||||
// Create Buttons
|
||||
NSButton *callbackButton = [[NSButton alloc] initWithFrame:NSMakeRect(5, 0, 120, 40)];
|
||||
[callbackButton setTitle:@"Call handler"];
|
||||
[callbackButton setBezelStyle:NSRoundedBezelStyle];
|
||||
[callbackButton setTarget:self];
|
||||
[callbackButton setAction:@selector(_callHandler)];
|
||||
[_webView addSubview:callbackButton];
|
||||
|
||||
NSButton *webViewToggleButton = [[NSButton alloc] initWithFrame:NSMakeRect(120, 0, 180, 40)];
|
||||
[webViewToggleButton setTitle:@"Switch to WKWebView"];
|
||||
[webViewToggleButton setBezelStyle:NSRoundedBezelStyle];
|
||||
[webViewToggleButton setTarget:self];
|
||||
[webViewToggleButton setAction:@selector(_toggleExample)];
|
||||
[_webView addSubview:webViewToggleButton];
|
||||
|
||||
|
||||
// Load Page
|
||||
NSString* htmlPath = [[NSBundle mainBundle] pathForResource:@"ExampleApp" ofType:@"html"];
|
||||
NSString* html = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil];
|
||||
NSURL *baseURL = [NSURL fileURLWithPath:htmlPath];
|
||||
[[_webView mainFrame] loadHTMLString:html baseURL: baseURL];
|
||||
}
|
||||
|
||||
|
||||
- (void)_configureWKWebview {
|
||||
// Create Bridge
|
||||
_WKBridge = [WebViewJavascriptBridge bridgeForWebView:_WKWebView];
|
||||
|
||||
[_WKBridge registerHandler:@"testObjcCallback" handler:^(id data, WVJBResponseCallback responseCallback) {
|
||||
NSLog(@"testObjcCallback called: %@", data);
|
||||
responseCallback(@"Response from testObjcCallback");
|
||||
}];
|
||||
|
||||
[_WKBridge callHandler:@"testJavascriptHandler" data:@{ @"foo":@"before ready" }];
|
||||
|
||||
// Create Buttons
|
||||
NSButton *callbackButton = [[NSButton alloc] initWithFrame:NSMakeRect(5, 0, 120, 40)];
|
||||
[callbackButton setTitle:@"Call handler"];
|
||||
[callbackButton setBezelStyle:NSRoundedBezelStyle];
|
||||
[callbackButton setTarget:self];
|
||||
[callbackButton setAction:@selector(_WKCallHandler)];
|
||||
[_WKWebView addSubview:callbackButton];
|
||||
|
||||
NSButton *webViewToggleButton = [[NSButton alloc] initWithFrame:NSMakeRect(120, 0, 180, 40)];
|
||||
[webViewToggleButton setTitle:@"Switch to WebView"];
|
||||
[webViewToggleButton setBezelStyle:NSRoundedBezelStyle];
|
||||
[webViewToggleButton setTarget:self];
|
||||
[webViewToggleButton setAction:@selector(_toggleExample)];
|
||||
[_WKWebView addSubview:webViewToggleButton];
|
||||
|
||||
// Load Page
|
||||
NSString* htmlPath = [[NSBundle mainBundle] pathForResource:@"ExampleApp" ofType:@"html"];
|
||||
NSString* html = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil];
|
||||
NSURL *baseURL = [NSURL fileURLWithPath:htmlPath];
|
||||
[_WKWebView loadHTMLString:html baseURL:baseURL];
|
||||
}
|
||||
|
||||
-(void)_toggleExample {
|
||||
_WKWebView.hidden = !_WKWebView.isHidden;
|
||||
_webView.hidden = !_webView.isHidden;
|
||||
}
|
||||
|
||||
- (void)_callHandler {
|
||||
id data = @{ @"greetingFromObjC": @"Hi there, JS!" };
|
||||
[_bridge callHandler:@"testJavascriptHandler" data:data responseCallback:^(id response) {
|
||||
NSLog(@"testJavascriptHandler responded: %@", response);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)_WKCallHandler {
|
||||
id data = @{ @"greetingFromObjC": @"Hi there, JS!" };
|
||||
[_WKBridge callHandler:@"testJavascriptHandler" data:data responseCallback:^(id response) {
|
||||
NSLog(@"testJavascriptHandler responded: %@", response);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)_createViews {
|
||||
NSView* contentView = _window.contentView;
|
||||
// WebView
|
||||
_webView = [[WebView alloc] initWithFrame:contentView.frame];
|
||||
[_webView setAutoresizingMask:(NSViewHeightSizable | NSViewWidthSizable)];
|
||||
_webView.hidden = YES;
|
||||
|
||||
// WKWebView
|
||||
_WKWebView = [[WKWebView alloc] initWithFrame:contentView.frame];
|
||||
[_WKWebView setAutoresizingMask:(NSViewHeightSizable | NSViewWidthSizable)];
|
||||
|
||||
[contentView addSubview:_WKWebView];
|
||||
[contentView addSubview:_webView];
|
||||
}
|
||||
|
||||
|
||||
@end
|
34
Example Apps/ExampleApp-OSX/ExampleApp-OSX-Info.plist
Normal file
34
Example Apps/ExampleApp-OSX/ExampleApp-OSX-Info.plist
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2013 Marcus Westin. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
7
Example Apps/ExampleApp-OSX/ExampleApp-OSX-Prefix.pch
Normal file
7
Example Apps/ExampleApp-OSX/ExampleApp-OSX-Prefix.pch
Normal file
@ -0,0 +1,7 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'ExampleApp-OSX' target in the 'ExampleApp-OSX' project
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
3244
Example Apps/ExampleApp-OSX/MainMenu.xib
Normal file
3244
Example Apps/ExampleApp-OSX/MainMenu.xib
Normal file
File diff suppressed because it is too large
Load Diff
29
Example Apps/ExampleApp-OSX/en.lproj/Credits.rtf
Normal file
29
Example Apps/ExampleApp-OSX/en.lproj/Credits.rtf
Normal file
@ -0,0 +1,29 @@
|
||||
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\paperw9840\paperh8400
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
|
||||
|
||||
\f0\b\fs24 \cf0 Engineering:
|
||||
\b0 \
|
||||
Some people\
|
||||
\
|
||||
|
||||
\b Human Interface Design:
|
||||
\b0 \
|
||||
Some other people\
|
||||
\
|
||||
|
||||
\b Testing:
|
||||
\b0 \
|
||||
Hopefully not nobody\
|
||||
\
|
||||
|
||||
\b Documentation:
|
||||
\b0 \
|
||||
Whoever\
|
||||
\
|
||||
|
||||
\b With special thanks to:
|
||||
\b0 \
|
||||
Mom\
|
||||
}
|
2
Example Apps/ExampleApp-OSX/en.lproj/InfoPlist.strings
Normal file
2
Example Apps/ExampleApp-OSX/en.lproj/InfoPlist.strings
Normal file
@ -0,0 +1,2 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
14
Example Apps/ExampleApp-OSX/main.m
Normal file
14
Example Apps/ExampleApp-OSX/main.m
Normal file
@ -0,0 +1,14 @@
|
||||
//
|
||||
// main.m
|
||||
// ExampleApp-OSX
|
||||
//
|
||||
// Created by Marcus Westin on 6/8/13.
|
||||
// Copyright (c) 2013 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
372
Example Apps/ExampleApp-iOS.xcodeproj/project.pbxproj
Normal file
372
Example Apps/ExampleApp-iOS.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,372 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
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 */; };
|
||||
2C1562C0176BA63500B4AE50 /* WebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C1562A9176B9F6200B4AE50 /* WebViewJavascriptBridge.m */; };
|
||||
2C3E7C461C5A890A00A1E322 /* WebViewJavascriptBridge_JS.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C3E7C451C5A890A00A1E322 /* WebViewJavascriptBridge_JS.m */; };
|
||||
2C45CA2C1884AD520002A4E2 /* ExampleUIWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C45CA2B1884AD520002A4E2 /* ExampleUIWebViewController.m */; };
|
||||
2CA045BF17117439006DEE8B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2CA045B717117439006DEE8B /* InfoPlist.strings */; };
|
||||
2CA045C217117439006DEE8B /* ExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CA045BD17117439006DEE8B /* ExampleAppDelegate.m */; };
|
||||
2CA045C317117439006DEE8B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CA045BE17117439006DEE8B /* main.m */; };
|
||||
2CA0465C1711AC8E006DEE8B /* ExampleApp.html in Resources */ = {isa = PBXBuildFile; fileRef = 2CA0465B1711AC8D006DEE8B /* ExampleApp.html */; };
|
||||
2CAB869B1727684300BD9ED1 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2CAB869A1727684300BD9ED1 /* Default-568h@2x.png */; };
|
||||
2CEB3EC01602563600548120 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2CEB3EBF1602563600548120 /* UIKit.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0E50601B1A01B442000BEEEA /* WebViewJavascriptBridgeBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridgeBase.m; sourceTree = "<group>"; };
|
||||
0E50601D1A01B44C000BEEEA /* WebViewJavascriptBridgeBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridgeBase.h; sourceTree = "<group>"; };
|
||||
0E8082D919EDC32300479452 /* WKWebViewJavascriptBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewJavascriptBridge.h; sourceTree = "<group>"; };
|
||||
0E8082DA19EDC32300479452 /* WKWebViewJavascriptBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKWebViewJavascriptBridge.m; sourceTree = "<group>"; };
|
||||
0E8082DC19EDD98700479452 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
|
||||
0ECB01421A0EE1BA0037FF4E /* ExampleWKWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExampleWKWebViewController.h; sourceTree = "<group>"; };
|
||||
0ECB01431A0EE1F20037FF4E /* ExampleWKWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleWKWebViewController.m; sourceTree = "<group>"; };
|
||||
2C1562A8176B9F6200B4AE50 /* WebViewJavascriptBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge.h; sourceTree = "<group>"; };
|
||||
2C1562A9176B9F6200B4AE50 /* WebViewJavascriptBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge.m; sourceTree = "<group>"; };
|
||||
2C3E7C441C5A890A00A1E322 /* WebViewJavascriptBridge_JS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge_JS.h; sourceTree = "<group>"; };
|
||||
2C3E7C451C5A890A00A1E322 /* WebViewJavascriptBridge_JS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge_JS.m; sourceTree = "<group>"; };
|
||||
2C45CA2A1884AD520002A4E2 /* ExampleUIWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExampleUIWebViewController.h; sourceTree = "<group>"; };
|
||||
2C45CA2B1884AD520002A4E2 /* ExampleUIWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleUIWebViewController.m; sourceTree = "<group>"; };
|
||||
2CA045B817117439006DEE8B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
2CA045B917117439006DEE8B /* ExampleApp-iOS-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ExampleApp-iOS-Info.plist"; sourceTree = "<group>"; };
|
||||
2CA045BA17117439006DEE8B /* ExampleApp-iOS-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ExampleApp-iOS-Prefix.pch"; sourceTree = "<group>"; };
|
||||
2CA045BC17117439006DEE8B /* ExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExampleAppDelegate.h; sourceTree = "<group>"; };
|
||||
2CA045BD17117439006DEE8B /* ExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleAppDelegate.m; sourceTree = "<group>"; };
|
||||
2CA045BE17117439006DEE8B /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
2CA0465B1711AC8D006DEE8B /* ExampleApp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = ExampleApp.html; sourceTree = SOURCE_ROOT; };
|
||||
2CAB869A1727684300BD9ED1 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "ExampleApp-iOS/Default-568h@2x.png"; sourceTree = "<group>"; };
|
||||
2CEB3EBB1602563600548120 /* ExampleApp-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ExampleApp-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2CEB3EBF1602563600548120 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
2CEB3EC11602563600548120 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
2CEB3EC31602563600548120 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2CEB3EB81602563600548120 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
0E4E9D4C1A101E0B00043087 /* WebKit.framework in Frameworks */,
|
||||
2CEB3EC01602563600548120 /* UIKit.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2C1562A7176B9F5400B4AE50 /* WebViewJavascriptBridge */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2C3E7C441C5A890A00A1E322 /* WebViewJavascriptBridge_JS.h */,
|
||||
2C3E7C451C5A890A00A1E322 /* WebViewJavascriptBridge_JS.m */,
|
||||
2C1562A8176B9F6200B4AE50 /* WebViewJavascriptBridge.h */,
|
||||
2C1562A9176B9F6200B4AE50 /* WebViewJavascriptBridge.m */,
|
||||
0E8082DA19EDC32300479452 /* WKWebViewJavascriptBridge.m */,
|
||||
0E8082D919EDC32300479452 /* WKWebViewJavascriptBridge.h */,
|
||||
0E50601B1A01B442000BEEEA /* WebViewJavascriptBridgeBase.m */,
|
||||
0E50601D1A01B44C000BEEEA /* WebViewJavascriptBridgeBase.h */,
|
||||
);
|
||||
name = WebViewJavascriptBridge;
|
||||
path = ../../WebViewJavascriptBridge;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2CA045B617117439006DEE8B /* ExampleApp-iOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2CA0465B1711AC8D006DEE8B /* ExampleApp.html */,
|
||||
2CA045BC17117439006DEE8B /* ExampleAppDelegate.h */,
|
||||
2CA045BD17117439006DEE8B /* ExampleAppDelegate.m */,
|
||||
2C45CA2A1884AD520002A4E2 /* ExampleUIWebViewController.h */,
|
||||
2C45CA2B1884AD520002A4E2 /* ExampleUIWebViewController.m */,
|
||||
0ECB01421A0EE1BA0037FF4E /* ExampleWKWebViewController.h */,
|
||||
0ECB01431A0EE1F20037FF4E /* ExampleWKWebViewController.m */,
|
||||
2C1562A7176B9F5400B4AE50 /* WebViewJavascriptBridge */,
|
||||
2CA046211711A94E006DEE8B /* Supporting Files */,
|
||||
);
|
||||
path = "ExampleApp-iOS";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2CA046211711A94E006DEE8B /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2CA045B717117439006DEE8B /* InfoPlist.strings */,
|
||||
2CA045B917117439006DEE8B /* ExampleApp-iOS-Info.plist */,
|
||||
2CA045BA17117439006DEE8B /* ExampleApp-iOS-Prefix.pch */,
|
||||
2CA045BE17117439006DEE8B /* main.m */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2CEB3EB01602563600548120 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2CAB869A1727684300BD9ED1 /* Default-568h@2x.png */,
|
||||
2CA045B617117439006DEE8B /* ExampleApp-iOS */,
|
||||
2CEB3EBE1602563600548120 /* Frameworks */,
|
||||
2CEB3EBC1602563600548120 /* Products */,
|
||||
81A733051B2F9C5795D856E4 /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2CEB3EBC1602563600548120 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2CEB3EBB1602563600548120 /* ExampleApp-iOS.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2CEB3EBE1602563600548120 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0E8082DC19EDD98700479452 /* WebKit.framework */,
|
||||
2CEB3EBF1602563600548120 /* UIKit.framework */,
|
||||
2CEB3EC11602563600548120 /* Foundation.framework */,
|
||||
2CEB3EC31602563600548120 /* CoreGraphics.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
81A733051B2F9C5795D856E4 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2CEB3EBA1602563600548120 /* ExampleApp-iOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2CEB3ED31602563600548120 /* Build configuration list for PBXNativeTarget "ExampleApp-iOS" */;
|
||||
buildPhases = (
|
||||
2CEB3EB71602563600548120 /* Sources */,
|
||||
2CEB3EB81602563600548120 /* Frameworks */,
|
||||
2CEB3EB91602563600548120 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "ExampleApp-iOS";
|
||||
productName = ExampleApp;
|
||||
productReference = 2CEB3EBB1602563600548120 /* ExampleApp-iOS.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
2CEB3EB21602563600548120 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0810;
|
||||
ORGANIZATIONNAME = "Marcus Westin";
|
||||
TargetAttributes = {
|
||||
2CEB3EBA1602563600548120 = {
|
||||
LastSwiftMigration = 0820;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 2CEB3EB51602563600548120 /* Build configuration list for PBXProject "ExampleApp-iOS" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 2CEB3EB01602563600548120;
|
||||
productRefGroup = 2CEB3EBC1602563600548120 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
2CEB3EBA1602563600548120 /* ExampleApp-iOS */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
2CEB3EB91602563600548120 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2CA045BF17117439006DEE8B /* InfoPlist.strings in Resources */,
|
||||
2CA0465C1711AC8E006DEE8B /* ExampleApp.html in Resources */,
|
||||
2CAB869B1727684300BD9ED1 /* Default-568h@2x.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2CEB3EB71602563600548120 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2C3E7C461C5A890A00A1E322 /* WebViewJavascriptBridge_JS.m in Sources */,
|
||||
2C1562C0176BA63500B4AE50 /* WebViewJavascriptBridge.m in Sources */,
|
||||
0E8082DB19EDC32300479452 /* WKWebViewJavascriptBridge.m in Sources */,
|
||||
2C45CA2C1884AD520002A4E2 /* ExampleUIWebViewController.m in Sources */,
|
||||
0ECB01441A0EE1F20037FF4E /* ExampleWKWebViewController.m in Sources */,
|
||||
2CA045C217117439006DEE8B /* ExampleAppDelegate.m in Sources */,
|
||||
0E50601C1A01B442000BEEEA /* WebViewJavascriptBridgeBase.m in Sources */,
|
||||
2CA045C317117439006DEE8B /* main.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
2CA045B717117439006DEE8B /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
2CA045B817117439006DEE8B /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2CEB3ED11602563600548120 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2CEB3ED21602563600548120 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
2CEB3ED41602563600548120 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
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 = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.example.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = "ExampleApp-iOS";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2CEB3ED51602563600548120 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
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 = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.example.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = "ExampleApp-iOS";
|
||||
SWIFT_VERSION = 3.0;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2CEB3EB51602563600548120 /* Build configuration list for PBXProject "ExampleApp-iOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2CEB3ED11602563600548120 /* Debug */,
|
||||
2CEB3ED21602563600548120 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2CEB3ED31602563600548120 /* Build configuration list for PBXNativeTarget "ExampleApp-iOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2CEB3ED41602563600548120 /* Debug */,
|
||||
2CEB3ED51602563600548120 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 2CEB3EB21602563600548120 /* Project object */;
|
||||
}
|
BIN
Example Apps/ExampleApp-iOS/Default-568h@2x.png
Normal file
BIN
Example Apps/ExampleApp-iOS/Default-568h@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
36
Example Apps/ExampleApp-iOS/ExampleApp-iOS-Info.plist
Normal file
36
Example Apps/ExampleApp-iOS/ExampleApp-iOS-Info.plist
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
14
Example Apps/ExampleApp-iOS/ExampleApp-iOS-Prefix.pch
Normal file
14
Example Apps/ExampleApp-iOS/ExampleApp-iOS-Prefix.pch
Normal file
@ -0,0 +1,14 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'ExampleApp' target in the 'ExampleApp' project
|
||||
//
|
||||
|
||||
#import <Availability.h>
|
||||
|
||||
#ifndef __IPHONE_3_0
|
||||
#warning "This project uses features only available in iOS SDK 3.0 and later."
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
5
Example Apps/ExampleApp-iOS/ExampleAppDelegate.h
Normal file
5
Example Apps/ExampleApp-iOS/ExampleAppDelegate.h
Normal file
@ -0,0 +1,5 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface ExampleAppDelegate : UIResponder <UIApplicationDelegate>
|
||||
@property (nonatomic) UIWindow *window;
|
||||
@end
|
30
Example Apps/ExampleApp-iOS/ExampleAppDelegate.m
Normal file
30
Example Apps/ExampleApp-iOS/ExampleAppDelegate.m
Normal file
@ -0,0 +1,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
|
13
Example Apps/ExampleApp-iOS/ExampleUIWebViewController.h
Normal file
13
Example Apps/ExampleApp-iOS/ExampleUIWebViewController.h
Normal file
@ -0,0 +1,13 @@
|
||||
//
|
||||
// ExampleUIWebViewController.h
|
||||
// ExampleApp-iOS
|
||||
//
|
||||
// Created by Marcus Westin on 1/13/14.
|
||||
// Copyright (c) 2014 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface ExampleUIWebViewController : UINavigationController <UIWebViewDelegate>
|
||||
|
||||
@end
|
90
Example Apps/ExampleApp-iOS/ExampleUIWebViewController.m
Normal file
90
Example Apps/ExampleApp-iOS/ExampleUIWebViewController.m
Normal file
@ -0,0 +1,90 @@
|
||||
//
|
||||
// ExampleUIWebViewController.m
|
||||
// ExampleApp-iOS
|
||||
//
|
||||
// Created by Marcus Westin on 1/13/14.
|
||||
// Copyright (c) 2014 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ExampleUIWebViewController.h"
|
||||
#import "WebViewJavascriptBridge.h"
|
||||
|
||||
@interface ExampleUIWebViewController ()
|
||||
@property WebViewJavascriptBridge* bridge;
|
||||
@end
|
||||
|
||||
@implementation ExampleUIWebViewController
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
if (_bridge) { return; }
|
||||
|
||||
UIWebView* webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
|
||||
[self.view addSubview:webView];
|
||||
|
||||
[WebViewJavascriptBridge enableLogging];
|
||||
|
||||
_bridge = [WebViewJavascriptBridge bridgeForWebView:webView];
|
||||
[_bridge setWebViewDelegate:self];
|
||||
|
||||
[_bridge registerHandler:@"testObjcCallback" handler:^(id data, WVJBResponseCallback responseCallback) {
|
||||
NSLog(@"testObjcCallback called: %@", data);
|
||||
responseCallback(@"Response from testObjcCallback");
|
||||
}];
|
||||
|
||||
[_bridge callHandler:@"testJavascriptHandler" data:@{ @"foo":@"before ready" }];
|
||||
|
||||
[self renderButtons:webView];
|
||||
[self loadExamplePage:webView];
|
||||
}
|
||||
|
||||
- (void)webViewDidStartLoad:(UIWebView *)webView {
|
||||
NSLog(@"webViewDidStartLoad");
|
||||
}
|
||||
|
||||
- (void)webViewDidFinishLoad:(UIWebView *)webView {
|
||||
NSLog(@"webViewDidFinishLoad");
|
||||
}
|
||||
|
||||
- (void)renderButtons:(UIWebView*)webView {
|
||||
UIFont* font = [UIFont fontWithName:@"HelveticaNeue" size:11.0];
|
||||
|
||||
UIButton *callbackButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
|
||||
[callbackButton setTitle:@"Call handler" forState:UIControlStateNormal];
|
||||
[callbackButton addTarget:self action:@selector(callHandler:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.view insertSubview:callbackButton aboveSubview:webView];
|
||||
callbackButton.frame = CGRectMake(0, 400, 100, 35);
|
||||
callbackButton.titleLabel.font = font;
|
||||
|
||||
UIButton* reloadButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
|
||||
[reloadButton setTitle:@"Reload webview" forState:UIControlStateNormal];
|
||||
[reloadButton addTarget:webView action:@selector(reload) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.view insertSubview:reloadButton aboveSubview:webView];
|
||||
reloadButton.frame = CGRectMake(90, 400, 100, 35);
|
||||
reloadButton.titleLabel.font = font;
|
||||
|
||||
UIButton* safetyTimeoutButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
|
||||
[safetyTimeoutButton setTitle:@"Disable safety timeout" forState:UIControlStateNormal];
|
||||
[safetyTimeoutButton addTarget:self action:@selector(disableSafetyTimeout) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.view insertSubview:safetyTimeoutButton aboveSubview:webView];
|
||||
safetyTimeoutButton.frame = CGRectMake(190, 400, 120, 35);
|
||||
safetyTimeoutButton.titleLabel.font = font;
|
||||
}
|
||||
|
||||
- (void)disableSafetyTimeout {
|
||||
[self.bridge disableJavscriptAlertBoxSafetyTimeout];
|
||||
}
|
||||
|
||||
- (void)callHandler:(id)sender {
|
||||
id data = @{ @"greetingFromObjC": @"Hi there, JS!" };
|
||||
[_bridge callHandler:@"testJavascriptHandler" data:data responseCallback:^(id response) {
|
||||
NSLog(@"testJavascriptHandler responded: %@", response);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)loadExamplePage:(UIWebView*)webView {
|
||||
NSString* htmlPath = [[NSBundle mainBundle] pathForResource:@"ExampleApp" ofType:@"html"];
|
||||
NSString* appHtml = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil];
|
||||
NSURL *baseURL = [NSURL fileURLWithPath:htmlPath];
|
||||
[webView loadHTMLString:appHtml baseURL:baseURL];
|
||||
}
|
||||
@end
|
14
Example Apps/ExampleApp-iOS/ExampleWKWebViewController.h
Normal file
14
Example Apps/ExampleApp-iOS/ExampleWKWebViewController.h
Normal file
@ -0,0 +1,14 @@
|
||||
//
|
||||
// ExampleWKWebViewController.h
|
||||
// ExampleApp-iOS
|
||||
//
|
||||
// Created by Marcus Westin on 1/13/14.
|
||||
// Copyright (c) 2014 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
@interface ExampleWKWebViewController : UINavigationController<WKNavigationDelegate>
|
||||
|
||||
@end
|
80
Example Apps/ExampleApp-iOS/ExampleWKWebViewController.m
Normal file
80
Example Apps/ExampleApp-iOS/ExampleWKWebViewController.m
Normal file
@ -0,0 +1,80 @@
|
||||
//
|
||||
// ExampleWKWebViewController.m
|
||||
// ExampleApp-iOS
|
||||
//
|
||||
// Created by Marcus Westin on 1/13/14.
|
||||
// Copyright (c) 2014 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ExampleWKWebViewController.h"
|
||||
#import "WebViewJavascriptBridge.h"
|
||||
|
||||
@interface ExampleWKWebViewController ()
|
||||
|
||||
@property WebViewJavascriptBridge* bridge;
|
||||
|
||||
@end
|
||||
|
||||
@implementation ExampleWKWebViewController
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
if (_bridge) { return; }
|
||||
|
||||
WKWebView* webView = [[NSClassFromString(@"WKWebView") alloc] initWithFrame:self.view.bounds];
|
||||
webView.navigationDelegate = self;
|
||||
[self.view addSubview:webView];
|
||||
[WebViewJavascriptBridge enableLogging];
|
||||
_bridge = [WebViewJavascriptBridge bridgeForWebView:webView];
|
||||
[_bridge setWebViewDelegate:self];
|
||||
|
||||
[_bridge registerHandler:@"testObjcCallback" handler:^(id data, WVJBResponseCallback responseCallback) {
|
||||
NSLog(@"testObjcCallback called: %@", data);
|
||||
responseCallback(@"Response from testObjcCallback");
|
||||
}];
|
||||
|
||||
[_bridge callHandler:@"testJavascriptHandler" data:@{ @"foo":@"before ready" }];
|
||||
|
||||
[self renderButtons:webView];
|
||||
[self loadExamplePage:webView];
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation {
|
||||
NSLog(@"webViewDidStartLoad");
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
|
||||
NSLog(@"webViewDidFinishLoad");
|
||||
}
|
||||
|
||||
- (void)renderButtons:(WKWebView*)webView {
|
||||
UIFont* font = [UIFont fontWithName:@"HelveticaNeue" size:12.0];
|
||||
|
||||
UIButton *callbackButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
|
||||
[callbackButton setTitle:@"Call handler" forState:UIControlStateNormal];
|
||||
[callbackButton addTarget:self action:@selector(callHandler:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.view insertSubview:callbackButton aboveSubview:webView];
|
||||
callbackButton.frame = CGRectMake(10, 400, 100, 35);
|
||||
callbackButton.titleLabel.font = font;
|
||||
|
||||
UIButton* reloadButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
|
||||
[reloadButton setTitle:@"Reload webview" forState:UIControlStateNormal];
|
||||
[reloadButton addTarget:webView action:@selector(reload) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.view insertSubview:reloadButton aboveSubview:webView];
|
||||
reloadButton.frame = CGRectMake(110, 400, 100, 35);
|
||||
reloadButton.titleLabel.font = font;
|
||||
}
|
||||
|
||||
- (void)callHandler:(id)sender {
|
||||
id data = @{ @"greetingFromObjC": @"Hi there, JS!" };
|
||||
[_bridge callHandler:@"testJavascriptHandler" data:data responseCallback:^(id response) {
|
||||
NSLog(@"testJavascriptHandler responded: %@", response);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)loadExamplePage:(WKWebView*)webView {
|
||||
NSString* htmlPath = [[NSBundle mainBundle] pathForResource:@"ExampleApp" ofType:@"html"];
|
||||
NSString* appHtml = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil];
|
||||
NSURL *baseURL = [NSURL fileURLWithPath:htmlPath];
|
||||
[webView loadHTMLString:appHtml baseURL:baseURL];
|
||||
}
|
||||
@end
|
2
Example Apps/ExampleApp-iOS/en.lproj/InfoPlist.strings
Normal file
2
Example Apps/ExampleApp-iOS/en.lproj/InfoPlist.strings
Normal file
@ -0,0 +1,2 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
26
Example Apps/ExampleApp-iOS/main.m
Normal file
26
Example Apps/ExampleApp-iOS/main.m
Normal file
@ -0,0 +1,26 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <TargetConditionals.h>
|
||||
#import <dlfcn.h>
|
||||
#import "ExampleAppDelegate.h"
|
||||
|
||||
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
@autoreleasepool {
|
||||
// Dynamically load WebKit if iOS version >= 8
|
||||
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
NSString *frameworkPath = [[NSProcessInfo processInfo] environment][@"DYLD_FALLBACK_FRAMEWORK_PATH"];
|
||||
if (frameworkPath) {
|
||||
NSString *webkitLibraryPath = [NSString pathWithComponents:@[frameworkPath, @"WebKit.framework", @"WebKit"]];
|
||||
dlopen([webkitLibraryPath cStringUsingEncoding:NSUTF8StringEncoding], RTLD_LAZY);
|
||||
}
|
||||
#else
|
||||
dlopen("/System/Library/Frameworks/WebKit.framework/WebKit", RTLD_LAZY);
|
||||
#endif
|
||||
}
|
||||
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([ExampleAppDelegate class]));
|
||||
}
|
||||
}
|
60
Example Apps/ExampleApp.html
Normal file
60
Example Apps/ExampleApp.html
Normal file
@ -0,0 +1,60 @@
|
||||
<!doctype html>
|
||||
<html><head>
|
||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
<style type='text/css'>
|
||||
html { font-family:Helvetica; color:#222; }
|
||||
h1 { color:steelblue; font-size:24px; margin-top:24px; }
|
||||
button { margin:0 3px 10px; font-size:12px; }
|
||||
.logLine { border-bottom:1px solid #ccc; padding:4px 2px; font-family:courier; font-size:11px; }
|
||||
</style>
|
||||
</head><body>
|
||||
<h1>WebViewJavascriptBridge Demo</h1>
|
||||
<script>
|
||||
window.onerror = function(err) {
|
||||
log('window.onerror: ' + err)
|
||||
}
|
||||
|
||||
function setupWebViewJavascriptBridge(callback) {
|
||||
if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
|
||||
if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
|
||||
window.WVJBCallbacks = [callback];
|
||||
var WVJBIframe = document.createElement('iframe');
|
||||
WVJBIframe.style.display = 'none';
|
||||
WVJBIframe.src = 'https://__bridge_loaded__';
|
||||
document.documentElement.appendChild(WVJBIframe);
|
||||
setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
|
||||
}
|
||||
|
||||
setupWebViewJavascriptBridge(function(bridge) {
|
||||
var uniqueId = 1
|
||||
function log(message, data) {
|
||||
var log = document.getElementById('log')
|
||||
var el = document.createElement('div')
|
||||
el.className = 'logLine'
|
||||
el.innerHTML = uniqueId++ + '. ' + message + ':<br/>' + JSON.stringify(data)
|
||||
if (log.children.length) { log.insertBefore(el, log.children[0]) }
|
||||
else { log.appendChild(el) }
|
||||
}
|
||||
|
||||
bridge.registerHandler('testJavascriptHandler', function(data, responseCallback) {
|
||||
log('ObjC called testJavascriptHandler with', data)
|
||||
var responseData = { 'Javascript Says':'Right back atcha!' }
|
||||
log('JS responding with', responseData)
|
||||
responseCallback(responseData)
|
||||
})
|
||||
|
||||
document.body.appendChild(document.createElement('br'))
|
||||
|
||||
var callbackButton = document.getElementById('buttons').appendChild(document.createElement('button'))
|
||||
callbackButton.innerHTML = 'Fire testObjcCallback'
|
||||
callbackButton.onclick = function(e) {
|
||||
e.preventDefault()
|
||||
log('JS calling handler "testObjcCallback"')
|
||||
bridge.callHandler('testObjcCallback', {'foo': 'bar'}, function(response) {
|
||||
log('JS got response', response)
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<div id='buttons'></div> <div id='log'></div>
|
||||
</body></html>
|
@ -0,0 +1,568 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2C85D0041E12D13E00B5BB1F /* echo.html in Resources */ = {isa = PBXBuildFile; fileRef = 2C85D0031E12D13E00B5BB1F /* echo.html */; };
|
||||
2C85D0051E12D13E00B5BB1F /* echo.html in Resources */ = {isa = PBXBuildFile; fileRef = 2C85D0031E12D13E00B5BB1F /* echo.html */; };
|
||||
2CF20A991E12BB3F00D3009D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CF20A981E12BB3F00D3009D /* AppDelegate.swift */; };
|
||||
2CF20A9B1E12BB3F00D3009D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CF20A9A1E12BB3F00D3009D /* ViewController.swift */; };
|
||||
2CF20A9E1E12BB3F00D3009D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2CF20A9C1E12BB3F00D3009D /* Main.storyboard */; };
|
||||
2CF20AA01E12BB3F00D3009D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2CF20A9F1E12BB3F00D3009D /* Assets.xcassets */; };
|
||||
2CF20AA31E12BB3F00D3009D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2CF20AA11E12BB3F00D3009D /* LaunchScreen.storyboard */; };
|
||||
2CF20AAE1E12BB3F00D3009D /* ExampleSwiftApp_iOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CF20AAD1E12BB3F00D3009D /* ExampleSwiftApp_iOSTests.swift */; };
|
||||
D8CEA1425EC257C350E1AB7B /* Pods_ExampleSwiftApp_iOSTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F83CA56A2551209150BE3026 /* Pods_ExampleSwiftApp_iOSTests.framework */; };
|
||||
F2E5C0A8E08BEBA27AF5E74A /* Pods_ExampleSwiftApp_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEA6EDCA550904DB02B48E33 /* Pods_ExampleSwiftApp_iOS.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
2CF20AAA1E12BB3F00D3009D /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2CF20A8D1E12BB3F00D3009D /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 2CF20A941E12BB3F00D3009D;
|
||||
remoteInfo = "ExampleSwiftApp-iOS";
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2C85D0031E12D13E00B5BB1F /* echo.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = echo.html; sourceTree = "<group>"; };
|
||||
2CF20A951E12BB3F00D3009D /* ExampleSwiftApp-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ExampleSwiftApp-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2CF20A981E12BB3F00D3009D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
2CF20A9A1E12BB3F00D3009D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
2CF20A9D1E12BB3F00D3009D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
2CF20A9F1E12BB3F00D3009D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
2CF20AA21E12BB3F00D3009D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
2CF20AA41E12BB3F00D3009D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
2CF20AA91E12BB3F00D3009D /* ExampleSwiftApp-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ExampleSwiftApp-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2CF20AAD1E12BB3F00D3009D /* ExampleSwiftApp_iOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleSwiftApp_iOSTests.swift; sourceTree = "<group>"; };
|
||||
2CF20AAF1E12BB3F00D3009D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
428486AD61C115757F5B2D0E /* Pods-ExampleSwiftApp-iOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ExampleSwiftApp-iOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
501BFA93F6923681FFC52CCF /* Pods-ExampleSwiftApp-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ExampleSwiftApp-iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
540FA2D8150D626B9E77FAB0 /* Pods-ExampleSwiftApp-iOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ExampleSwiftApp-iOSTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
BEA6EDCA550904DB02B48E33 /* Pods_ExampleSwiftApp_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ExampleSwiftApp_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C5654CD94CAAAA26115AFE32 /* Pods-ExampleSwiftApp-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ExampleSwiftApp-iOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.release.xcconfig"; sourceTree = "<group>"; };
|
||||
F83CA56A2551209150BE3026 /* Pods_ExampleSwiftApp_iOSTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ExampleSwiftApp_iOSTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2CF20A921E12BB3F00D3009D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F2E5C0A8E08BEBA27AF5E74A /* Pods_ExampleSwiftApp_iOS.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2CF20AA61E12BB3F00D3009D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D8CEA1425EC257C350E1AB7B /* Pods_ExampleSwiftApp_iOSTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2CF20A8C1E12BB3F00D3009D = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2C85D0031E12D13E00B5BB1F /* echo.html */,
|
||||
2CF20A971E12BB3F00D3009D /* ExampleSwiftApp-iOS */,
|
||||
2CF20AAC1E12BB3F00D3009D /* ExampleSwiftApp-iOSTests */,
|
||||
2CF20A961E12BB3F00D3009D /* Products */,
|
||||
9F0299D3BBA025224C110345 /* Pods */,
|
||||
6303D0CF3CEDE121D7B2EAE7 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2CF20A961E12BB3F00D3009D /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2CF20A951E12BB3F00D3009D /* ExampleSwiftApp-iOS.app */,
|
||||
2CF20AA91E12BB3F00D3009D /* ExampleSwiftApp-iOSTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2CF20A971E12BB3F00D3009D /* ExampleSwiftApp-iOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2CF20A981E12BB3F00D3009D /* AppDelegate.swift */,
|
||||
2CF20A9A1E12BB3F00D3009D /* ViewController.swift */,
|
||||
2CF20A9C1E12BB3F00D3009D /* Main.storyboard */,
|
||||
2CF20A9F1E12BB3F00D3009D /* Assets.xcassets */,
|
||||
2CF20AA11E12BB3F00D3009D /* LaunchScreen.storyboard */,
|
||||
2CF20AA41E12BB3F00D3009D /* Info.plist */,
|
||||
);
|
||||
path = "ExampleSwiftApp-iOS";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2CF20AAC1E12BB3F00D3009D /* ExampleSwiftApp-iOSTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2CF20AAD1E12BB3F00D3009D /* ExampleSwiftApp_iOSTests.swift */,
|
||||
2CF20AAF1E12BB3F00D3009D /* Info.plist */,
|
||||
);
|
||||
path = "ExampleSwiftApp-iOSTests";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6303D0CF3CEDE121D7B2EAE7 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BEA6EDCA550904DB02B48E33 /* Pods_ExampleSwiftApp_iOS.framework */,
|
||||
F83CA56A2551209150BE3026 /* Pods_ExampleSwiftApp_iOSTests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9F0299D3BBA025224C110345 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
501BFA93F6923681FFC52CCF /* Pods-ExampleSwiftApp-iOS.debug.xcconfig */,
|
||||
C5654CD94CAAAA26115AFE32 /* Pods-ExampleSwiftApp-iOS.release.xcconfig */,
|
||||
540FA2D8150D626B9E77FAB0 /* Pods-ExampleSwiftApp-iOSTests.debug.xcconfig */,
|
||||
428486AD61C115757F5B2D0E /* Pods-ExampleSwiftApp-iOSTests.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2CF20A941E12BB3F00D3009D /* ExampleSwiftApp-iOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2CF20AB21E12BB3F00D3009D /* Build configuration list for PBXNativeTarget "ExampleSwiftApp-iOS" */;
|
||||
buildPhases = (
|
||||
E1EE87376320127A646E0030 /* [CP] Check Pods Manifest.lock */,
|
||||
2CF20A911E12BB3F00D3009D /* Sources */,
|
||||
2CF20A921E12BB3F00D3009D /* Frameworks */,
|
||||
2CF20A931E12BB3F00D3009D /* Resources */,
|
||||
BA4C674FF1CCCC87D20090E4 /* [CP] Embed Pods Frameworks */,
|
||||
F106D79C2CD5F06E8F3F438D /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "ExampleSwiftApp-iOS";
|
||||
productName = "ExampleSwiftApp-iOS";
|
||||
productReference = 2CF20A951E12BB3F00D3009D /* ExampleSwiftApp-iOS.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
2CF20AA81E12BB3F00D3009D /* ExampleSwiftApp-iOSTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2CF20AB51E12BB3F00D3009D /* Build configuration list for PBXNativeTarget "ExampleSwiftApp-iOSTests" */;
|
||||
buildPhases = (
|
||||
4889AB1A10A2C9552E6BBD23 /* [CP] Check Pods Manifest.lock */,
|
||||
2CF20AA51E12BB3F00D3009D /* Sources */,
|
||||
2CF20AA61E12BB3F00D3009D /* Frameworks */,
|
||||
2CF20AA71E12BB3F00D3009D /* Resources */,
|
||||
329B179F6DF51F14F9B1629B /* [CP] Embed Pods Frameworks */,
|
||||
50CDAEBCB453B9875E9F7147 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
2CF20AAB1E12BB3F00D3009D /* PBXTargetDependency */,
|
||||
);
|
||||
name = "ExampleSwiftApp-iOSTests";
|
||||
productName = "ExampleSwiftApp-iOSTests";
|
||||
productReference = 2CF20AA91E12BB3F00D3009D /* ExampleSwiftApp-iOSTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
2CF20A8D1E12BB3F00D3009D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0820;
|
||||
LastUpgradeCheck = 0820;
|
||||
ORGANIZATIONNAME = "Marcus Westin";
|
||||
TargetAttributes = {
|
||||
2CF20A941E12BB3F00D3009D = {
|
||||
CreatedOnToolsVersion = 8.2.1;
|
||||
LastSwiftMigration = 0910;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
2CF20AA81E12BB3F00D3009D = {
|
||||
CreatedOnToolsVersion = 8.2.1;
|
||||
LastSwiftMigration = 0910;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = 2CF20A941E12BB3F00D3009D;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 2CF20A901E12BB3F00D3009D /* Build configuration list for PBXProject "ExampleSwiftApp-iOS" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 2CF20A8C1E12BB3F00D3009D;
|
||||
productRefGroup = 2CF20A961E12BB3F00D3009D /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
2CF20A941E12BB3F00D3009D /* ExampleSwiftApp-iOS */,
|
||||
2CF20AA81E12BB3F00D3009D /* ExampleSwiftApp-iOSTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
2CF20A931E12BB3F00D3009D /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2CF20AA31E12BB3F00D3009D /* LaunchScreen.storyboard in Resources */,
|
||||
2CF20AA01E12BB3F00D3009D /* Assets.xcassets in Resources */,
|
||||
2CF20A9E1E12BB3F00D3009D /* Main.storyboard in Resources */,
|
||||
2C85D0041E12D13E00B5BB1F /* echo.html in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2CF20AA71E12BB3F00D3009D /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2C85D0051E12D13E00B5BB1F /* echo.html in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
329B179F6DF51F14F9B1629B /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
4889AB1A10A2C9552E6BBD23 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
50CDAEBCB453B9875E9F7147 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
BA4C674FF1CCCC87D20090E4 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
E1EE87376320127A646E0030 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
F106D79C2CD5F06E8F3F438D /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2CF20A911E12BB3F00D3009D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2CF20A9B1E12BB3F00D3009D /* ViewController.swift in Sources */,
|
||||
2CF20A991E12BB3F00D3009D /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2CF20AA51E12BB3F00D3009D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2CF20AAE1E12BB3F00D3009D /* ExampleSwiftApp_iOSTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
2CF20AAB1E12BB3F00D3009D /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 2CF20A941E12BB3F00D3009D /* ExampleSwiftApp-iOS */;
|
||||
targetProxy = 2CF20AAA1E12BB3F00D3009D /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
2CF20A9C1E12BB3F00D3009D /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
2CF20A9D1E12BB3F00D3009D /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2CF20AA11E12BB3F00D3009D /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
2CF20AA21E12BB3F00D3009D /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2CF20AB01E12BB3F00D3009D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2CF20AB11E12BB3F00D3009D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
2CF20AB31E12BB3F00D3009D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 501BFA93F6923681FFC52CCF /* Pods-ExampleSwiftApp-iOS.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = "ExampleSwiftApp-iOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "in.marcuswest.ExampleSwiftApp-iOS";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2CF20AB41E12BB3F00D3009D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C5654CD94CAAAA26115AFE32 /* Pods-ExampleSwiftApp-iOS.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
INFOPLIST_FILE = "ExampleSwiftApp-iOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "in.marcuswest.ExampleSwiftApp-iOS";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
2CF20AB61E12BB3F00D3009D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 540FA2D8150D626B9E77FAB0 /* Pods-ExampleSwiftApp-iOSTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = "ExampleSwiftApp-iOSTests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "in.marcuswest.ExampleSwiftApp-iOSTests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ExampleSwiftApp-iOS.app/ExampleSwiftApp-iOS";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2CF20AB71E12BB3F00D3009D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 428486AD61C115757F5B2D0E /* Pods-ExampleSwiftApp-iOSTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = "ExampleSwiftApp-iOSTests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "in.marcuswest.ExampleSwiftApp-iOSTests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ExampleSwiftApp-iOS.app/ExampleSwiftApp-iOS";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2CF20A901E12BB3F00D3009D /* Build configuration list for PBXProject "ExampleSwiftApp-iOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2CF20AB01E12BB3F00D3009D /* Debug */,
|
||||
2CF20AB11E12BB3F00D3009D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2CF20AB21E12BB3F00D3009D /* Build configuration list for PBXNativeTarget "ExampleSwiftApp-iOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2CF20AB31E12BB3F00D3009D /* Debug */,
|
||||
2CF20AB41E12BB3F00D3009D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2CF20AB51E12BB3F00D3009D /* Build configuration list for PBXNativeTarget "ExampleSwiftApp-iOSTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2CF20AB61E12BB3F00D3009D /* Debug */,
|
||||
2CF20AB71E12BB3F00D3009D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 2CF20A8D1E12BB3F00D3009D /* Project object */;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// ExampleSwiftApp-iOS
|
||||
//
|
||||
// Created by John Marcus Westin on 12/27/16.
|
||||
// Copyright © 2016 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import WebViewJavascriptBridge
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillResignActive(_ application: UIApplication) {
|
||||
// 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.
|
||||
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||
// 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.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||
// 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.
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
// 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.
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,68 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,25 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// ExampleSwiftApp-iOS
|
||||
//
|
||||
// Created by John Marcus Westin on 12/27/16.
|
||||
// Copyright © 2016 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ViewController: UIViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
}
|
||||
|
||||
override func didReceiveMemoryWarning() {
|
||||
super.didReceiveMemoryWarning()
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,211 @@
|
||||
//
|
||||
// ExampleSwiftApp_iOSTests.swift
|
||||
// ExampleSwiftApp-iOSTests
|
||||
//
|
||||
// Created by John Marcus Westin on 12/27/16.
|
||||
// Copyright © 2016 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import WebKit
|
||||
|
||||
import WebViewJavascriptBridge
|
||||
@testable import ExampleSwiftApp_iOS
|
||||
|
||||
let timeout: Double = 3
|
||||
|
||||
class ExampleSwiftApp_iOSTests: XCTestCase {
|
||||
var uiWebView: UIWebView = UIWebView.init()
|
||||
var wkWebView: WKWebView = WKWebView.init()
|
||||
var bridgeRefs: NSMutableArray = []
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
let rootVC = (UIApplication.shared.delegate as! AppDelegate).window!.rootViewController!
|
||||
var frame = rootVC.view.bounds
|
||||
frame.size.height /= 2
|
||||
|
||||
uiWebView = UIWebView.init(frame: frame)
|
||||
uiWebView.backgroundColor = UIColor.blue
|
||||
rootVC.view.addSubview(uiWebView)
|
||||
|
||||
frame.origin.y += frame.size.height
|
||||
wkWebView = WKWebView.init(frame: frame)
|
||||
wkWebView.backgroundColor = UIColor.red
|
||||
rootVC.view.addSubview(wkWebView)
|
||||
|
||||
bridgeRefs = NSMutableArray.init()
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
uiWebView.removeFromSuperview()
|
||||
wkWebView.removeFromSuperview()
|
||||
}
|
||||
|
||||
func bridgeForWebView(_ webView: Any) -> WebViewJavascriptBridge {
|
||||
let bridge = WebViewJavascriptBridge.init(webView)!
|
||||
bridgeRefs.add(bridge)
|
||||
return bridge
|
||||
}
|
||||
|
||||
func loadEchoSample(_ webView: Any) {
|
||||
let request = URLRequest.init(url: Bundle.main.url(forResource: "echo", withExtension: "html")!)
|
||||
if webView is UIWebView {
|
||||
(webView as! UIWebView).loadRequest(request)
|
||||
} else {
|
||||
(webView as! WKWebView).load(request)
|
||||
}
|
||||
}
|
||||
|
||||
func testSetup() {
|
||||
_testSetup(webView: uiWebView)
|
||||
_testSetup(webView: wkWebView)
|
||||
waitForExpectations(timeout: timeout, handler: nil)
|
||||
}
|
||||
func _testSetup(webView: Any) {
|
||||
let setup = self.expectation(description: "Setup completed")
|
||||
let bridge = self.bridgeForWebView(webView)
|
||||
bridge.registerHandler("Greet") { (data, responseCallback) in
|
||||
XCTAssertEqual(data as! String, "Hello world")
|
||||
setup.fulfill()
|
||||
}
|
||||
XCTAssertNotNil(bridge)
|
||||
self.loadEchoSample(webView)
|
||||
}
|
||||
|
||||
|
||||
func testEchoHandler() {
|
||||
_testEchoHandler(uiWebView)
|
||||
_testEchoHandler(wkWebView)
|
||||
waitForExpectations(timeout: timeout, handler: nil)
|
||||
}
|
||||
func _testEchoHandler(_ webView: Any) {
|
||||
let bridge = bridgeForWebView(webView)
|
||||
|
||||
let callbackInvoked = expectation(description: "Callback invoked")
|
||||
bridge.callHandler("echoHandler", data:"testEchoHandler") { (responseData) in
|
||||
XCTAssertEqual(responseData as! String, "testEchoHandler");
|
||||
callbackInvoked.fulfill()
|
||||
};
|
||||
|
||||
loadEchoSample(webView);
|
||||
}
|
||||
|
||||
func testEchoHandlerAfterSetup() {
|
||||
_testEchoHandlerAfterSetup(uiWebView)
|
||||
_testEchoHandlerAfterSetup(wkWebView)
|
||||
waitForExpectations(timeout: timeout, handler: nil)
|
||||
}
|
||||
func _testEchoHandlerAfterSetup(_ webView: Any) {
|
||||
let bridge = bridgeForWebView(webView)
|
||||
|
||||
let callbackInvoked = expectation(description: "Callback invoked")
|
||||
loadEchoSample(webView);
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.150) {
|
||||
bridge.callHandler("echoHandler", data:"testEchoHandler") { (responseData) in
|
||||
XCTAssertEqual(responseData as! String, "testEchoHandler")
|
||||
callbackInvoked.fulfill()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func testObjectEncoding() {
|
||||
_testObjectEncoding(uiWebView)
|
||||
_testObjectEncoding(wkWebView)
|
||||
waitForExpectations(timeout: timeout, handler: nil)
|
||||
}
|
||||
func _testObjectEncoding(_ webView: Any) {
|
||||
let bridge = bridgeForWebView(webView)
|
||||
|
||||
func echoObject(_ object: Any) {
|
||||
let callbackInvoked = expectation(description: "Callback invoked")
|
||||
bridge.callHandler("echoHandler", data:object) { (responseData) in
|
||||
if (object is NSDictionary) {
|
||||
XCTAssertEqual(responseData as! NSDictionary, object as! NSDictionary)
|
||||
} else if (object is NSArray) {
|
||||
XCTAssertEqual(responseData as! NSArray, object as! NSArray)
|
||||
}
|
||||
callbackInvoked.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
echoObject("A string sent over the wire");
|
||||
echoObject("A string with '\"'/\\");
|
||||
echoObject([1, 2, 3]);
|
||||
echoObject(["a":1, "b":2]);
|
||||
|
||||
loadEchoSample(webView);
|
||||
}
|
||||
|
||||
func testJavascriptReceiveResponse() {
|
||||
_testJavascriptReceiveResponse(uiWebView)
|
||||
_testJavascriptReceiveResponse(wkWebView)
|
||||
waitForExpectations(timeout: timeout, handler: nil)
|
||||
}
|
||||
func _testJavascriptReceiveResponse(_ webView: Any) {
|
||||
let bridge = bridgeForWebView(webView)
|
||||
loadEchoSample(webView);
|
||||
let callbackInvoked = expectation(description: "Callback invoked")
|
||||
bridge.registerHandler("objcEchoToJs") { (data, responseCallback) in
|
||||
XCTAssertEqual(data as! NSDictionary, ["foo":"bar"]);
|
||||
responseCallback!(data)
|
||||
}
|
||||
bridge.callHandler("jsRcvResponseTest", data:nil) { (responseData) in
|
||||
XCTAssertEqual(responseData as! String, "Response from JS");
|
||||
callbackInvoked.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
func testJavascriptReceiveResponseWithoutSafetyTimeout() {
|
||||
_testJavascriptReceiveResponseWithoutSafetyTimeout(uiWebView)
|
||||
_testJavascriptReceiveResponseWithoutSafetyTimeout(wkWebView)
|
||||
waitForExpectations(timeout: timeout, handler: nil)
|
||||
}
|
||||
func _testJavascriptReceiveResponseWithoutSafetyTimeout(_ webView: Any) {
|
||||
let bridge = bridgeForWebView(webView)
|
||||
bridge.disableJavscriptAlertBoxSafetyTimeout()
|
||||
loadEchoSample(webView);
|
||||
let callbackInvoked = expectation(description: "Callback invoked")
|
||||
bridge.registerHandler("objcEchoToJs") { (data, responseCallback) in
|
||||
XCTAssertEqual(data as! NSDictionary, ["foo":"bar"]);
|
||||
responseCallback!(data);
|
||||
}
|
||||
bridge.callHandler("jsRcvResponseTest", data:nil) { (responseData) in
|
||||
XCTAssertEqual(responseData as! String, "Response from JS");
|
||||
callbackInvoked.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
func testRemoveHandler() {
|
||||
_testRemoveHandler(uiWebView)
|
||||
_testRemoveHandler(wkWebView)
|
||||
waitForExpectations(timeout: timeout, handler: nil)
|
||||
}
|
||||
func _testRemoveHandler(_ webView: Any) {
|
||||
loadEchoSample(webView);
|
||||
let bridge = bridgeForWebView(webView)
|
||||
let callbackNotInvoked = expectation(description: "Callback invoked")
|
||||
var count = 0
|
||||
bridge.registerHandler("objcEchoToJs") { (data, callback) in
|
||||
count += 1
|
||||
callback!(data)
|
||||
}
|
||||
bridge.callHandler("jsRcvResponseTest", data:nil) { (responseData) in
|
||||
XCTAssertEqual(responseData as! String, "Response from JS");
|
||||
bridge.removeHandler("objcEchoToJs")
|
||||
bridge.callHandler("jsRcvResponseTest", data:nil) { (responseData) in
|
||||
// Since we have removed the "objcEchoToJs" handler, and since the
|
||||
// echo.html javascript won't call the response callback until it has
|
||||
// received a response from "objcEchoToJs", we should never get here
|
||||
XCTAssert(false)
|
||||
}
|
||||
bridge.callHandler("echoHandler", data:nil ) { (responseData) in
|
||||
XCTAssertEqual(count, 1)
|
||||
callbackNotInvoked.fulfill()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
18
Example Apps/ExampleSwiftApp-iOS/Podfile
Normal file
18
Example Apps/ExampleSwiftApp-iOS/Podfile
Normal file
@ -0,0 +1,18 @@
|
||||
project 'ExampleSwiftApp-iOS.xcodeproj'
|
||||
|
||||
# Uncomment the next line to define a global platform for your project
|
||||
platform :ios, '9.0'
|
||||
use_frameworks!
|
||||
|
||||
target 'ExampleSwiftApp-iOS' do
|
||||
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
|
||||
|
||||
pod 'WebViewJavascriptBridge', :path => '../..'
|
||||
|
||||
target 'ExampleSwiftApp-iOSTests' do
|
||||
inherit! :search_paths
|
||||
|
||||
pod 'WebViewJavascriptBridge', :path => '../..'
|
||||
end
|
||||
|
||||
end
|
16
Example Apps/ExampleSwiftApp-iOS/Podfile.lock
Normal file
16
Example Apps/ExampleSwiftApp-iOS/Podfile.lock
Normal file
@ -0,0 +1,16 @@
|
||||
PODS:
|
||||
- WebViewJavascriptBridge (6.0.2)
|
||||
|
||||
DEPENDENCIES:
|
||||
- WebViewJavascriptBridge (from `../..`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
WebViewJavascriptBridge:
|
||||
:path: ../..
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
WebViewJavascriptBridge: 791ee0e26d1bf15efe5fb7fb9666a71a19b89d77
|
||||
|
||||
PODFILE CHECKSUM: f657cfcc5a24b7c7f0c7781719b73d4a834bc276
|
||||
|
||||
COCOAPODS: 1.1.1
|
35
Example Apps/ExampleSwiftApp-iOS/Pods/Local Podspecs/WebViewJavascriptBridge.podspec.json
generated
Normal file
35
Example Apps/ExampleSwiftApp-iOS/Pods/Local Podspecs/WebViewJavascriptBridge.podspec.json
generated
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "WebViewJavascriptBridge",
|
||||
"version": "6.0.2",
|
||||
"summary": "An iOS & OSX bridge for sending messages between Obj-C/Swift and JavaScript in WKWebViews, UIWebViews & WebViews.",
|
||||
"homepage": "https://github.com/marcuswestin/WebViewJavascriptBridge",
|
||||
"license": {
|
||||
"type": "MIT",
|
||||
"file": "LICENSE"
|
||||
},
|
||||
"authors": {
|
||||
"marcuswestin": "marcus.westin@gmail.com"
|
||||
},
|
||||
"source": {
|
||||
"git": "https://github.com/marcuswestin/WebViewJavascriptBridge.git",
|
||||
"tag": "v6.0.2"
|
||||
},
|
||||
"platforms": {
|
||||
"ios": "5.0",
|
||||
"osx": ""
|
||||
},
|
||||
"requires_arc": true,
|
||||
"ios": {
|
||||
"source_files": "WebViewJavascriptBridge/*.{h,m}",
|
||||
"private_header_files": "WebViewJavascriptBridge/WebViewJavascriptBridge_JS.h",
|
||||
"frameworks": [
|
||||
"UIKit",
|
||||
"WebKit"
|
||||
]
|
||||
},
|
||||
"osx": {
|
||||
"source_files": "WebViewJavascriptBridge/*.{h,m}",
|
||||
"private_header_files": "WebViewJavascriptBridge/WebViewJavascriptBridge_JS.h"
|
||||
},
|
||||
"frameworks": "WebKit"
|
||||
}
|
16
Example Apps/ExampleSwiftApp-iOS/Pods/Manifest.lock
generated
Normal file
16
Example Apps/ExampleSwiftApp-iOS/Pods/Manifest.lock
generated
Normal file
@ -0,0 +1,16 @@
|
||||
PODS:
|
||||
- WebViewJavascriptBridge (6.0.2)
|
||||
|
||||
DEPENDENCIES:
|
||||
- WebViewJavascriptBridge (from `../..`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
WebViewJavascriptBridge:
|
||||
:path: ../..
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
WebViewJavascriptBridge: 791ee0e26d1bf15efe5fb7fb9666a71a19b89d77
|
||||
|
||||
PODFILE CHECKSUM: f657cfcc5a24b7c7f0c7781719b73d4a834bc276
|
||||
|
||||
COCOAPODS: 1.1.1
|
746
Example Apps/ExampleSwiftApp-iOS/Pods/Pods.xcodeproj/project.pbxproj
generated
Normal file
746
Example Apps/ExampleSwiftApp-iOS/Pods/Pods.xcodeproj/project.pbxproj
generated
Normal file
@ -0,0 +1,746 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1CE763074FD41F8F2481F1F218DE4A8D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81607F20092CACC1394D3DCB7D6993B0 /* Foundation.framework */; };
|
||||
3CB3835FBA4FA17B69633D2A875158DD /* WebViewJavascriptBridge_JS.m in Sources */ = {isa = PBXBuildFile; fileRef = ECBC45CC74132CEFC65377142E782D6C /* WebViewJavascriptBridge_JS.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
|
||||
4250D949ECFC5A97E1770301D77E2605 /* WKWebViewJavascriptBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 80C51525CDB583C0489D564B2B01B11A /* WKWebViewJavascriptBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
45742C8C964B582FE0ADFF2E7905DFF5 /* WebViewJavascriptBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = E2A53CC2E9D7695847074947A62978CD /* WebViewJavascriptBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
4BB0061F245D474622102084EFAB5BD2 /* WebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = FE6B78215ECE85734B6458DD230E2364 /* WebViewJavascriptBridge.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
|
||||
502A928C6ABAB459D2BA4B139DA6E1B1 /* WebViewJavascriptBridgeBase.m in Sources */ = {isa = PBXBuildFile; fileRef = FE55E03982FB6FAB2D2EA3B51B77077C /* WebViewJavascriptBridgeBase.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
|
||||
64475BD96D86AB0FCCB594C527F1CAB8 /* WebViewJavascriptBridge-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 809AF8CF0188033BFA114CCE00D8B1BE /* WebViewJavascriptBridge-dummy.m */; };
|
||||
68865B6F5C4FE0AA46A28DCAC9F4FC2A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5147AE3C7F8B063B02257EFF0EFD800 /* UIKit.framework */; };
|
||||
8458FF2CDCD670B1FC51A7DDFD08255D /* WKWebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = CF0C2E9DF0EDC82844031C75B907FD1C /* WKWebViewJavascriptBridge.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
|
||||
84B65AC46F34EA67BF48C8C3E7E71958 /* WebViewJavascriptBridge-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 8601B0C4F04E6601DF1E5B029E37AB16 /* WebViewJavascriptBridge-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
86194B24481631A6A6D0A698889045E3 /* Pods-ExampleSwiftApp-iOSTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 51187EA2FE506237A47693D319F38538 /* Pods-ExampleSwiftApp-iOSTests-dummy.m */; };
|
||||
8F33194746E2C7D3D5BFE4E1FA5F8F11 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81607F20092CACC1394D3DCB7D6993B0 /* Foundation.framework */; };
|
||||
902762E83E038BF12A45D29D10921D42 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81607F20092CACC1394D3DCB7D6993B0 /* Foundation.framework */; };
|
||||
934D4692AC47E843BCD0C3B5751BC3E0 /* WebViewJavascriptBridge_JS.h in Headers */ = {isa = PBXBuildFile; fileRef = D02463846541C58A2828A6072E9B2B9F /* WebViewJavascriptBridge_JS.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
970CB101700BE9265F0267146F918345 /* WebViewJavascriptBridgeBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 57D0D1260897B04C231A6991D22E5429 /* WebViewJavascriptBridgeBase.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
EA1C1C1CC94437B705A83C5729E9480E /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FAF4F70740F05FA34D54F1982E18E7A /* WebKit.framework */; };
|
||||
F2BD89AED3B8530725EED73659CD7F72 /* Pods-ExampleSwiftApp-iOS-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 221FB5C393B5465B754FAF4DC182E72C /* Pods-ExampleSwiftApp-iOS-dummy.m */; };
|
||||
F6693066686B895A8F059D886F82D6A1 /* Pods-ExampleSwiftApp-iOS-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = C83E0A2774D73C8F7C5A71AE10D90669 /* Pods-ExampleSwiftApp-iOS-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
FF1285970402E7D12FC2D6EBE81D223E /* Pods-ExampleSwiftApp-iOSTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0DCBAEC1A0C74D1AFC55D1DA8CB0CC /* Pods-ExampleSwiftApp-iOSTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
4CFE87BDA707128AA8A6C5FC0C72AB8C /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = C1D60A5C9331D2F60A106303D3494E52;
|
||||
remoteInfo = WebViewJavascriptBridge;
|
||||
};
|
||||
5FFA8080C4895A871CEA5CBB57781845 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = C1D60A5C9331D2F60A106303D3494E52;
|
||||
remoteInfo = WebViewJavascriptBridge;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
074E573B7C4E7956272ECDDD90007364 /* WebViewJavascriptBridge.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = WebViewJavascriptBridge.xcconfig; sourceTree = "<group>"; };
|
||||
11B2B8BD3820A60AFC145AD769239715 /* Pods-ExampleSwiftApp-iOSTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-ExampleSwiftApp-iOSTests-resources.sh"; sourceTree = "<group>"; };
|
||||
153E8B22B37A83060A1543A8C162FF14 /* Pods_ExampleSwiftApp_iOSTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_ExampleSwiftApp_iOSTests.framework; path = "Pods-ExampleSwiftApp-iOSTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
16E86B5E097D5A8CE34F29BC6EC8562A /* Pods_ExampleSwiftApp_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_ExampleSwiftApp_iOS.framework; path = "Pods-ExampleSwiftApp-iOS.framework"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1E3A50278BA035C069540E5E3AB2AEE1 /* Pods-ExampleSwiftApp-iOS-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-ExampleSwiftApp-iOS-frameworks.sh"; sourceTree = "<group>"; };
|
||||
1FAF4F70740F05FA34D54F1982E18E7A /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/WebKit.framework; sourceTree = DEVELOPER_DIR; };
|
||||
221FB5C393B5465B754FAF4DC182E72C /* Pods-ExampleSwiftApp-iOS-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-ExampleSwiftApp-iOS-dummy.m"; sourceTree = "<group>"; };
|
||||
23D3E482532423C6D5312922387BEBC0 /* Pods-ExampleSwiftApp-iOSTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-ExampleSwiftApp-iOSTests-frameworks.sh"; sourceTree = "<group>"; };
|
||||
31A437740C886407B1BD834E14857AB2 /* Pods-ExampleSwiftApp-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ExampleSwiftApp-iOS.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
51187EA2FE506237A47693D319F38538 /* Pods-ExampleSwiftApp-iOSTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-ExampleSwiftApp-iOSTests-dummy.m"; sourceTree = "<group>"; };
|
||||
51711AC3868C2190C69CA4EE14609033 /* Pods-ExampleSwiftApp-iOS-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-ExampleSwiftApp-iOS-acknowledgements.plist"; sourceTree = "<group>"; };
|
||||
57D0D1260897B04C231A6991D22E5429 /* WebViewJavascriptBridgeBase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridgeBase.h; sourceTree = "<group>"; };
|
||||
6D44F90D4EBEFA879E24602D9D112830 /* Pods-ExampleSwiftApp-iOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ExampleSwiftApp-iOSTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
6D8F8016ACD01541DE8081F8C58930B7 /* Pods-ExampleSwiftApp-iOSTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-ExampleSwiftApp-iOSTests-acknowledgements.markdown"; sourceTree = "<group>"; };
|
||||
710F90291714B9A1D4E8E2967AA7E943 /* Pods-ExampleSwiftApp-iOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ExampleSwiftApp-iOSTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
7B0012B4474436C3998A7A0A253BB7FE /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
809AF8CF0188033BFA114CCE00D8B1BE /* WebViewJavascriptBridge-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "WebViewJavascriptBridge-dummy.m"; sourceTree = "<group>"; };
|
||||
80C51525CDB583C0489D564B2B01B11A /* WKWebViewJavascriptBridge.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WKWebViewJavascriptBridge.h; sourceTree = "<group>"; };
|
||||
81607F20092CACC1394D3DCB7D6993B0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
|
||||
8601B0C4F04E6601DF1E5B029E37AB16 /* WebViewJavascriptBridge-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "WebViewJavascriptBridge-umbrella.h"; sourceTree = "<group>"; };
|
||||
92A1209FAB40669DA320B3F83F0A3933 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
932785F7067BA34CED10E511033B8A87 /* Pods-ExampleSwiftApp-iOS-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-ExampleSwiftApp-iOS-acknowledgements.markdown"; sourceTree = "<group>"; };
|
||||
93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
|
||||
9F83FE7CA7AEEB63554078FAAB16CE8A /* WebViewJavascriptBridge.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = WebViewJavascriptBridge.framework; path = WebViewJavascriptBridge.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A17E3228DC6A2FAA18E03C30E1780481 /* Pods-ExampleSwiftApp-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ExampleSwiftApp-iOS.release.xcconfig"; sourceTree = "<group>"; };
|
||||
A3E25E1708830CCE4BAB07009465D3A0 /* WebViewJavascriptBridge-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "WebViewJavascriptBridge-prefix.pch"; sourceTree = "<group>"; };
|
||||
A8E9C149CADB94BAF0285D8FEC5B4543 /* Pods-ExampleSwiftApp-iOS.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-ExampleSwiftApp-iOS.modulemap"; sourceTree = "<group>"; };
|
||||
B3B2F31B7B3A2585AC20B9B1315640AF /* Pods-ExampleSwiftApp-iOSTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-ExampleSwiftApp-iOSTests.modulemap"; sourceTree = "<group>"; };
|
||||
C249E5C9809AB24175069C00CD913083 /* Pods-ExampleSwiftApp-iOSTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-ExampleSwiftApp-iOSTests-acknowledgements.plist"; sourceTree = "<group>"; };
|
||||
C83E0A2774D73C8F7C5A71AE10D90669 /* Pods-ExampleSwiftApp-iOS-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-ExampleSwiftApp-iOS-umbrella.h"; sourceTree = "<group>"; };
|
||||
CB0DCBAEC1A0C74D1AFC55D1DA8CB0CC /* Pods-ExampleSwiftApp-iOSTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-ExampleSwiftApp-iOSTests-umbrella.h"; sourceTree = "<group>"; };
|
||||
CF0C2E9DF0EDC82844031C75B907FD1C /* WKWebViewJavascriptBridge.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = WKWebViewJavascriptBridge.m; sourceTree = "<group>"; };
|
||||
D02463846541C58A2828A6072E9B2B9F /* WebViewJavascriptBridge_JS.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge_JS.h; sourceTree = "<group>"; };
|
||||
E2A53CC2E9D7695847074947A62978CD /* WebViewJavascriptBridge.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge.h; sourceTree = "<group>"; };
|
||||
EBC2E87E1DCDC145DB442F7AC9CEBB9E /* WebViewJavascriptBridge.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = WebViewJavascriptBridge.modulemap; sourceTree = "<group>"; };
|
||||
ECBC45CC74132CEFC65377142E782D6C /* WebViewJavascriptBridge_JS.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge_JS.m; sourceTree = "<group>"; };
|
||||
F392BCD91CC1BBCBEC3934F857C1D59C /* Pods-ExampleSwiftApp-iOS-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-ExampleSwiftApp-iOS-resources.sh"; sourceTree = "<group>"; };
|
||||
F5147AE3C7F8B063B02257EFF0EFD800 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
|
||||
FE21A82064159C68F43B52C838C010B1 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
FE55E03982FB6FAB2D2EA3B51B77077C /* WebViewJavascriptBridgeBase.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridgeBase.m; sourceTree = "<group>"; };
|
||||
FE6B78215ECE85734B6458DD230E2364 /* WebViewJavascriptBridge.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge.m; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
725CFEC49A26DCFA0EE64E353D657C0D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8F33194746E2C7D3D5BFE4E1FA5F8F11 /* Foundation.framework in Frameworks */,
|
||||
68865B6F5C4FE0AA46A28DCAC9F4FC2A /* UIKit.framework in Frameworks */,
|
||||
EA1C1C1CC94437B705A83C5729E9480E /* WebKit.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
857767A96DDF1BEA80FAB0218D443372 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1CE763074FD41F8F2481F1F218DE4A8D /* Foundation.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
890137DFC8228A2238111729EAD6DCB2 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
902762E83E038BF12A45D29D10921D42 /* Foundation.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
122DA2E5084A4393C29BE363C764795C /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6FFDF343B465C42F26242933972F7F1D /* iOS */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
24A5F2EBAAEACE0915403BD0A61B7BDB /* Development Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
BBA310B35CA03E5C16F75EB829798B19 /* WebViewJavascriptBridge */,
|
||||
);
|
||||
name = "Development Pods";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5F8EB9918E764211737A00481D412C60 /* Pods-ExampleSwiftApp-iOSTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
92A1209FAB40669DA320B3F83F0A3933 /* Info.plist */,
|
||||
B3B2F31B7B3A2585AC20B9B1315640AF /* Pods-ExampleSwiftApp-iOSTests.modulemap */,
|
||||
6D8F8016ACD01541DE8081F8C58930B7 /* Pods-ExampleSwiftApp-iOSTests-acknowledgements.markdown */,
|
||||
C249E5C9809AB24175069C00CD913083 /* Pods-ExampleSwiftApp-iOSTests-acknowledgements.plist */,
|
||||
51187EA2FE506237A47693D319F38538 /* Pods-ExampleSwiftApp-iOSTests-dummy.m */,
|
||||
23D3E482532423C6D5312922387BEBC0 /* Pods-ExampleSwiftApp-iOSTests-frameworks.sh */,
|
||||
11B2B8BD3820A60AFC145AD769239715 /* Pods-ExampleSwiftApp-iOSTests-resources.sh */,
|
||||
CB0DCBAEC1A0C74D1AFC55D1DA8CB0CC /* Pods-ExampleSwiftApp-iOSTests-umbrella.h */,
|
||||
710F90291714B9A1D4E8E2967AA7E943 /* Pods-ExampleSwiftApp-iOSTests.debug.xcconfig */,
|
||||
6D44F90D4EBEFA879E24602D9D112830 /* Pods-ExampleSwiftApp-iOSTests.release.xcconfig */,
|
||||
);
|
||||
name = "Pods-ExampleSwiftApp-iOSTests";
|
||||
path = "Target Support Files/Pods-ExampleSwiftApp-iOSTests";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6FFDF343B465C42F26242933972F7F1D /* iOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
81607F20092CACC1394D3DCB7D6993B0 /* Foundation.framework */,
|
||||
F5147AE3C7F8B063B02257EFF0EFD800 /* UIKit.framework */,
|
||||
1FAF4F70740F05FA34D54F1982E18E7A /* WebKit.framework */,
|
||||
);
|
||||
name = iOS;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
73C16EEBFFA1E1F4F0EAA9E996DDADFE /* Support Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FE21A82064159C68F43B52C838C010B1 /* Info.plist */,
|
||||
EBC2E87E1DCDC145DB442F7AC9CEBB9E /* WebViewJavascriptBridge.modulemap */,
|
||||
074E573B7C4E7956272ECDDD90007364 /* WebViewJavascriptBridge.xcconfig */,
|
||||
809AF8CF0188033BFA114CCE00D8B1BE /* WebViewJavascriptBridge-dummy.m */,
|
||||
A3E25E1708830CCE4BAB07009465D3A0 /* WebViewJavascriptBridge-prefix.pch */,
|
||||
8601B0C4F04E6601DF1E5B029E37AB16 /* WebViewJavascriptBridge-umbrella.h */,
|
||||
);
|
||||
name = "Support Files";
|
||||
path = "Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
78F44B0D402C2970C0507A1D9158BD94 /* Targets Support Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DE0ED14CB65A96D71C44D7BA5782E4C8 /* Pods-ExampleSwiftApp-iOS */,
|
||||
5F8EB9918E764211737A00481D412C60 /* Pods-ExampleSwiftApp-iOSTests */,
|
||||
);
|
||||
name = "Targets Support Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7DB346D0F39D3F0E887471402A8071AB = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */,
|
||||
24A5F2EBAAEACE0915403BD0A61B7BDB /* Development Pods */,
|
||||
122DA2E5084A4393C29BE363C764795C /* Frameworks */,
|
||||
E6006E29B8A33BE8A154EE70CB02A7D5 /* Products */,
|
||||
78F44B0D402C2970C0507A1D9158BD94 /* Targets Support Files */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
911475E28609F2390A280F1D8707E180 /* WebViewJavascriptBridge */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E2A53CC2E9D7695847074947A62978CD /* WebViewJavascriptBridge.h */,
|
||||
FE6B78215ECE85734B6458DD230E2364 /* WebViewJavascriptBridge.m */,
|
||||
D02463846541C58A2828A6072E9B2B9F /* WebViewJavascriptBridge_JS.h */,
|
||||
ECBC45CC74132CEFC65377142E782D6C /* WebViewJavascriptBridge_JS.m */,
|
||||
57D0D1260897B04C231A6991D22E5429 /* WebViewJavascriptBridgeBase.h */,
|
||||
FE55E03982FB6FAB2D2EA3B51B77077C /* WebViewJavascriptBridgeBase.m */,
|
||||
80C51525CDB583C0489D564B2B01B11A /* WKWebViewJavascriptBridge.h */,
|
||||
CF0C2E9DF0EDC82844031C75B907FD1C /* WKWebViewJavascriptBridge.m */,
|
||||
);
|
||||
name = WebViewJavascriptBridge;
|
||||
path = WebViewJavascriptBridge;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BBA310B35CA03E5C16F75EB829798B19 /* WebViewJavascriptBridge */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
73C16EEBFFA1E1F4F0EAA9E996DDADFE /* Support Files */,
|
||||
911475E28609F2390A280F1D8707E180 /* WebViewJavascriptBridge */,
|
||||
);
|
||||
name = WebViewJavascriptBridge;
|
||||
path = ../../..;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DE0ED14CB65A96D71C44D7BA5782E4C8 /* Pods-ExampleSwiftApp-iOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7B0012B4474436C3998A7A0A253BB7FE /* Info.plist */,
|
||||
A8E9C149CADB94BAF0285D8FEC5B4543 /* Pods-ExampleSwiftApp-iOS.modulemap */,
|
||||
932785F7067BA34CED10E511033B8A87 /* Pods-ExampleSwiftApp-iOS-acknowledgements.markdown */,
|
||||
51711AC3868C2190C69CA4EE14609033 /* Pods-ExampleSwiftApp-iOS-acknowledgements.plist */,
|
||||
221FB5C393B5465B754FAF4DC182E72C /* Pods-ExampleSwiftApp-iOS-dummy.m */,
|
||||
1E3A50278BA035C069540E5E3AB2AEE1 /* Pods-ExampleSwiftApp-iOS-frameworks.sh */,
|
||||
F392BCD91CC1BBCBEC3934F857C1D59C /* Pods-ExampleSwiftApp-iOS-resources.sh */,
|
||||
C83E0A2774D73C8F7C5A71AE10D90669 /* Pods-ExampleSwiftApp-iOS-umbrella.h */,
|
||||
31A437740C886407B1BD834E14857AB2 /* Pods-ExampleSwiftApp-iOS.debug.xcconfig */,
|
||||
A17E3228DC6A2FAA18E03C30E1780481 /* Pods-ExampleSwiftApp-iOS.release.xcconfig */,
|
||||
);
|
||||
name = "Pods-ExampleSwiftApp-iOS";
|
||||
path = "Target Support Files/Pods-ExampleSwiftApp-iOS";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E6006E29B8A33BE8A154EE70CB02A7D5 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
16E86B5E097D5A8CE34F29BC6EC8562A /* Pods_ExampleSwiftApp_iOS.framework */,
|
||||
153E8B22B37A83060A1543A8C162FF14 /* Pods_ExampleSwiftApp_iOSTests.framework */,
|
||||
9F83FE7CA7AEEB63554078FAAB16CE8A /* WebViewJavascriptBridge.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
734E3D2EE8FCFD6CEED32749CBAB5966 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
84B65AC46F34EA67BF48C8C3E7E71958 /* WebViewJavascriptBridge-umbrella.h in Headers */,
|
||||
45742C8C964B582FE0ADFF2E7905DFF5 /* WebViewJavascriptBridge.h in Headers */,
|
||||
934D4692AC47E843BCD0C3B5751BC3E0 /* WebViewJavascriptBridge_JS.h in Headers */,
|
||||
970CB101700BE9265F0267146F918345 /* WebViewJavascriptBridgeBase.h in Headers */,
|
||||
4250D949ECFC5A97E1770301D77E2605 /* WKWebViewJavascriptBridge.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
BD6C6E2FF5EA299771748CB4DED72704 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F6693066686B895A8F059D886F82D6A1 /* Pods-ExampleSwiftApp-iOS-umbrella.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D7AA88A6D68871CED7311BB22AC97F05 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FF1285970402E7D12FC2D6EBE81D223E /* Pods-ExampleSwiftApp-iOSTests-umbrella.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
A54833AA1912A64524F87E8A91967601 /* Pods-ExampleSwiftApp-iOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = BB29106CFF2F0230123BBB222DBAA8A3 /* Build configuration list for PBXNativeTarget "Pods-ExampleSwiftApp-iOS" */;
|
||||
buildPhases = (
|
||||
A0F68E6ED45928E82301EFB65D08C62D /* Sources */,
|
||||
857767A96DDF1BEA80FAB0218D443372 /* Frameworks */,
|
||||
BD6C6E2FF5EA299771748CB4DED72704 /* Headers */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
4C41CDA555C81C25F7F723E869937B51 /* PBXTargetDependency */,
|
||||
);
|
||||
name = "Pods-ExampleSwiftApp-iOS";
|
||||
productName = "Pods-ExampleSwiftApp-iOS";
|
||||
productReference = 16E86B5E097D5A8CE34F29BC6EC8562A /* Pods_ExampleSwiftApp_iOS.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
C1D60A5C9331D2F60A106303D3494E52 /* WebViewJavascriptBridge */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 15283965C689D50142F65CC947E95772 /* Build configuration list for PBXNativeTarget "WebViewJavascriptBridge" */;
|
||||
buildPhases = (
|
||||
1C606BE46617D22E9EA0F278CFBBF20D /* Sources */,
|
||||
725CFEC49A26DCFA0EE64E353D657C0D /* Frameworks */,
|
||||
734E3D2EE8FCFD6CEED32749CBAB5966 /* Headers */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = WebViewJavascriptBridge;
|
||||
productName = WebViewJavascriptBridge;
|
||||
productReference = 9F83FE7CA7AEEB63554078FAAB16CE8A /* WebViewJavascriptBridge.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
E44F08A1D65BDBC2B5BCB7C942113B9D /* Pods-ExampleSwiftApp-iOSTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 71C2414272E63AF42549A85955FBFB48 /* Build configuration list for PBXNativeTarget "Pods-ExampleSwiftApp-iOSTests" */;
|
||||
buildPhases = (
|
||||
79E093A84032034699562712B5C16611 /* Sources */,
|
||||
890137DFC8228A2238111729EAD6DCB2 /* Frameworks */,
|
||||
D7AA88A6D68871CED7311BB22AC97F05 /* Headers */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
A5ECEF2B489E810AD4D19BDA32BD0B6F /* PBXTargetDependency */,
|
||||
);
|
||||
name = "Pods-ExampleSwiftApp-iOSTests";
|
||||
productName = "Pods-ExampleSwiftApp-iOSTests";
|
||||
productReference = 153E8B22B37A83060A1543A8C162FF14 /* Pods_ExampleSwiftApp_iOSTests.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
D41D8CD98F00B204E9800998ECF8427E /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0730;
|
||||
LastUpgradeCheck = 0700;
|
||||
};
|
||||
buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 7DB346D0F39D3F0E887471402A8071AB;
|
||||
productRefGroup = E6006E29B8A33BE8A154EE70CB02A7D5 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
A54833AA1912A64524F87E8A91967601 /* Pods-ExampleSwiftApp-iOS */,
|
||||
E44F08A1D65BDBC2B5BCB7C942113B9D /* Pods-ExampleSwiftApp-iOSTests */,
|
||||
C1D60A5C9331D2F60A106303D3494E52 /* WebViewJavascriptBridge */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
1C606BE46617D22E9EA0F278CFBBF20D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
64475BD96D86AB0FCCB594C527F1CAB8 /* WebViewJavascriptBridge-dummy.m in Sources */,
|
||||
4BB0061F245D474622102084EFAB5BD2 /* WebViewJavascriptBridge.m in Sources */,
|
||||
3CB3835FBA4FA17B69633D2A875158DD /* WebViewJavascriptBridge_JS.m in Sources */,
|
||||
502A928C6ABAB459D2BA4B139DA6E1B1 /* WebViewJavascriptBridgeBase.m in Sources */,
|
||||
8458FF2CDCD670B1FC51A7DDFD08255D /* WKWebViewJavascriptBridge.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
79E093A84032034699562712B5C16611 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
86194B24481631A6A6D0A698889045E3 /* Pods-ExampleSwiftApp-iOSTests-dummy.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
A0F68E6ED45928E82301EFB65D08C62D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F2BD89AED3B8530725EED73659CD7F72 /* Pods-ExampleSwiftApp-iOS-dummy.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
4C41CDA555C81C25F7F723E869937B51 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = WebViewJavascriptBridge;
|
||||
target = C1D60A5C9331D2F60A106303D3494E52 /* WebViewJavascriptBridge */;
|
||||
targetProxy = 5FFA8080C4895A871CEA5CBB57781845 /* PBXContainerItemProxy */;
|
||||
};
|
||||
A5ECEF2B489E810AD4D19BDA32BD0B6F /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = WebViewJavascriptBridge;
|
||||
target = C1D60A5C9331D2F60A106303D3494E52 /* WebViewJavascriptBridge */;
|
||||
targetProxy = 4CFE87BDA707128AA8A6C5FC0C72AB8C /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
038CE773516022A9EA24BAE86FEE1F0B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 074E573B7C4E7956272ECDDD90007364 /* WebViewJavascriptBridge.xcconfig */;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREFIX_HEADER = "Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-prefix.pch";
|
||||
INFOPLIST_FILE = "Target Support Files/WebViewJavascriptBridge/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MODULEMAP_FILE = "Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge.modulemap";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_NAME = WebViewJavascriptBridge;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
183F4D214A091DB4B17ACFDEC53A6378 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = A17E3228DC6A2FAA18E03C30E1780481 /* Pods-ExampleSwiftApp-iOS.release.xcconfig */;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "Target Support Files/Pods-ExampleSwiftApp-iOS/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MACH_O_TYPE = staticlib;
|
||||
MODULEMAP_FILE = "Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.modulemap";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
OTHER_LDFLAGS = "";
|
||||
OTHER_LIBTOOLFLAGS = "";
|
||||
PODS_ROOT = "$(SRCROOT)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = Pods_ExampleSwiftApp_iOS;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
4DC1FAB6BB7E21E398D812098E4EA9A6 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 31A437740C886407B1BD834E14857AB2 /* Pods-ExampleSwiftApp-iOS.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "Target Support Files/Pods-ExampleSwiftApp-iOS/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MACH_O_TYPE = staticlib;
|
||||
MODULEMAP_FILE = "Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.modulemap";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
OTHER_LDFLAGS = "";
|
||||
OTHER_LIBTOOLFLAGS = "";
|
||||
PODS_ROOT = "$(SRCROOT)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = Pods_ExampleSwiftApp_iOS;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
59B042A655B7C20CBAB90E385BF4E4C7 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGNING_REQUIRED = NO;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"POD_CONFIGURATION_DEBUG=1",
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SYMROOT = "${SRCROOT}/../build";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
6D10B2247443F4A32F297F70584B2ECF /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 710F90291714B9A1D4E8E2967AA7E943 /* Pods-ExampleSwiftApp-iOSTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "Target Support Files/Pods-ExampleSwiftApp-iOSTests/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MACH_O_TYPE = staticlib;
|
||||
MODULEMAP_FILE = "Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.modulemap";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
OTHER_LDFLAGS = "";
|
||||
OTHER_LIBTOOLFLAGS = "";
|
||||
PODS_ROOT = "$(SRCROOT)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = Pods_ExampleSwiftApp_iOSTests;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
A595ED041DAD51092925AD1F85D81823 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 074E573B7C4E7956272ECDDD90007364 /* WebViewJavascriptBridge.xcconfig */;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREFIX_HEADER = "Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-prefix.pch";
|
||||
INFOPLIST_FILE = "Target Support Files/WebViewJavascriptBridge/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MODULEMAP_FILE = "Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge.modulemap";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_NAME = WebViewJavascriptBridge;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
B7324857C38B065FEB1EEE3105C2367A /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGNING_REQUIRED = NO;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"POD_CONFIGURATION_RELEASE=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SYMROOT = "${SRCROOT}/../build";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
E53ACF0949BA7DC515874F9EBEB78B27 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 6D44F90D4EBEFA879E24602D9D112830 /* Pods-ExampleSwiftApp-iOSTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "Target Support Files/Pods-ExampleSwiftApp-iOSTests/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MACH_O_TYPE = staticlib;
|
||||
MODULEMAP_FILE = "Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.modulemap";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
OTHER_LDFLAGS = "";
|
||||
OTHER_LIBTOOLFLAGS = "";
|
||||
PODS_ROOT = "$(SRCROOT)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = Pods_ExampleSwiftApp_iOSTests;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
15283965C689D50142F65CC947E95772 /* Build configuration list for PBXNativeTarget "WebViewJavascriptBridge" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
A595ED041DAD51092925AD1F85D81823 /* Debug */,
|
||||
038CE773516022A9EA24BAE86FEE1F0B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
59B042A655B7C20CBAB90E385BF4E4C7 /* Debug */,
|
||||
B7324857C38B065FEB1EEE3105C2367A /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
71C2414272E63AF42549A85955FBFB48 /* Build configuration list for PBXNativeTarget "Pods-ExampleSwiftApp-iOSTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
6D10B2247443F4A32F297F70584B2ECF /* Debug */,
|
||||
E53ACF0949BA7DC515874F9EBEB78B27 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
BB29106CFF2F0230123BBB222DBAA8A3 /* Build configuration list for PBXNativeTarget "Pods-ExampleSwiftApp-iOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
4DC1FAB6BB7E21E398D812098E4EA9A6 /* Debug */,
|
||||
183F4D214A091DB4B17ACFDEC53A6378 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
|
||||
}
|
26
Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Info.plist
generated
Normal file
26
Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Info.plist
generated
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,29 @@
|
||||
# Acknowledgements
|
||||
This application makes use of the following third party libraries:
|
||||
|
||||
## WebViewJavascriptBridge
|
||||
|
||||
Copyright (c) 2011-2015 Marcus Westin, Antoine Lagadec
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Generated by CocoaPods - https://cocoapods.org
|
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreferenceSpecifiers</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>This application makes use of the following third party libraries:</string>
|
||||
<key>Title</key>
|
||||
<string>Acknowledgements</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Copyright (c) 2011-2015 Marcus Westin, Antoine Lagadec
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
</string>
|
||||
<key>License</key>
|
||||
<string>MIT</string>
|
||||
<key>Title</key>
|
||||
<string>WebViewJavascriptBridge</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Generated by CocoaPods - https://cocoapods.org</string>
|
||||
<key>Title</key>
|
||||
<string></string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>StringsTable</key>
|
||||
<string>Acknowledgements</string>
|
||||
<key>Title</key>
|
||||
<string>Acknowledgements</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,5 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
@interface PodsDummy_Pods_ExampleSwiftApp_iOS : NSObject
|
||||
@end
|
||||
@implementation PodsDummy_Pods_ExampleSwiftApp_iOS
|
||||
@end
|
@ -0,0 +1,91 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
|
||||
|
||||
install_framework()
|
||||
{
|
||||
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
|
||||
local source="${BUILT_PRODUCTS_DIR}/$1"
|
||||
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
|
||||
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
|
||||
elif [ -r "$1" ]; then
|
||||
local source="$1"
|
||||
fi
|
||||
|
||||
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
if [ -L "${source}" ]; then
|
||||
echo "Symlinked..."
|
||||
source="$(readlink "${source}")"
|
||||
fi
|
||||
|
||||
# use filter instead of exclude so missing patterns dont' throw errors
|
||||
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
|
||||
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
|
||||
|
||||
local basename
|
||||
basename="$(basename -s .framework "$1")"
|
||||
binary="${destination}/${basename}.framework/${basename}"
|
||||
if ! [ -r "$binary" ]; then
|
||||
binary="${destination}/${basename}"
|
||||
fi
|
||||
|
||||
# Strip invalid architectures so "fat" simulator / device frameworks work on device
|
||||
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
|
||||
strip_invalid_archs "$binary"
|
||||
fi
|
||||
|
||||
# Resign the code if required by the build settings to avoid unstable apps
|
||||
code_sign_if_enabled "${destination}/$(basename "$1")"
|
||||
|
||||
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
|
||||
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
|
||||
local swift_runtime_libs
|
||||
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
|
||||
for lib in $swift_runtime_libs; do
|
||||
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
|
||||
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
|
||||
code_sign_if_enabled "${destination}/${lib}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# Signs a framework with the provided identity
|
||||
code_sign_if_enabled() {
|
||||
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
|
||||
# Use the current code_sign_identitiy
|
||||
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
|
||||
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
|
||||
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# Strip invalid architectures
|
||||
strip_invalid_archs() {
|
||||
binary="$1"
|
||||
# Get architectures for current file
|
||||
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
|
||||
stripped=""
|
||||
for arch in $archs; do
|
||||
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
|
||||
# Strip non-valid architectures in-place
|
||||
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
|
||||
stripped="$stripped $arch"
|
||||
fi
|
||||
done
|
||||
if [[ "$stripped" ]]; then
|
||||
echo "Stripped $binary of architectures:$stripped"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
||||
install_framework "$BUILT_PRODUCTS_DIR/WebViewJavascriptBridge/WebViewJavascriptBridge.framework"
|
||||
fi
|
||||
if [[ "$CONFIGURATION" == "Release" ]]; then
|
||||
install_framework "$BUILT_PRODUCTS_DIR/WebViewJavascriptBridge/WebViewJavascriptBridge.framework"
|
||||
fi
|
@ -0,0 +1,96 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
|
||||
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
|
||||
> "$RESOURCES_TO_COPY"
|
||||
|
||||
XCASSET_FILES=()
|
||||
|
||||
case "${TARGETED_DEVICE_FAMILY}" in
|
||||
1,2)
|
||||
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
|
||||
;;
|
||||
1)
|
||||
TARGET_DEVICE_ARGS="--target-device iphone"
|
||||
;;
|
||||
2)
|
||||
TARGET_DEVICE_ARGS="--target-device ipad"
|
||||
;;
|
||||
*)
|
||||
TARGET_DEVICE_ARGS="--target-device mac"
|
||||
;;
|
||||
esac
|
||||
|
||||
install_resource()
|
||||
{
|
||||
if [[ "$1" = /* ]] ; then
|
||||
RESOURCE_PATH="$1"
|
||||
else
|
||||
RESOURCE_PATH="${PODS_ROOT}/$1"
|
||||
fi
|
||||
if [[ ! -e "$RESOURCE_PATH" ]] ; then
|
||||
cat << EOM
|
||||
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
|
||||
EOM
|
||||
exit 1
|
||||
fi
|
||||
case $RESOURCE_PATH in
|
||||
*.storyboard)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
|
||||
;;
|
||||
*.xib)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
|
||||
;;
|
||||
*.framework)
|
||||
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
;;
|
||||
*.xcdatamodel)
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
|
||||
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
|
||||
;;
|
||||
*.xcdatamodeld)
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
|
||||
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
|
||||
;;
|
||||
*.xcmappingmodel)
|
||||
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
|
||||
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
|
||||
;;
|
||||
*.xcassets)
|
||||
ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
|
||||
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
|
||||
;;
|
||||
*)
|
||||
echo "$RESOURCE_PATH"
|
||||
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
|
||||
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
fi
|
||||
rm -f "$RESOURCES_TO_COPY"
|
||||
|
||||
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
|
||||
then
|
||||
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
|
||||
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
|
||||
while read line; do
|
||||
if [[ $line != "${PODS_ROOT}*" ]]; then
|
||||
XCASSET_FILES+=("$line")
|
||||
fi
|
||||
done <<<"$OTHER_XCASSETS"
|
||||
|
||||
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
fi
|
@ -0,0 +1,8 @@
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
||||
|
||||
|
||||
FOUNDATION_EXPORT double Pods_ExampleSwiftApp_iOSVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char Pods_ExampleSwiftApp_iOSVersionString[];
|
||||
|
@ -0,0 +1,9 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge/WebViewJavascriptBridge.framework/Headers"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "WebViewJavascriptBridge"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
@ -0,0 +1,6 @@
|
||||
framework module Pods_ExampleSwiftApp_iOS {
|
||||
umbrella header "Pods-ExampleSwiftApp-iOS-umbrella.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge/WebViewJavascriptBridge.framework/Headers"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "WebViewJavascriptBridge"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
26
Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Info.plist
generated
Normal file
26
Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Info.plist
generated
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,29 @@
|
||||
# Acknowledgements
|
||||
This application makes use of the following third party libraries:
|
||||
|
||||
## WebViewJavascriptBridge
|
||||
|
||||
Copyright (c) 2011-2015 Marcus Westin, Antoine Lagadec
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Generated by CocoaPods - https://cocoapods.org
|
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreferenceSpecifiers</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>This application makes use of the following third party libraries:</string>
|
||||
<key>Title</key>
|
||||
<string>Acknowledgements</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Copyright (c) 2011-2015 Marcus Westin, Antoine Lagadec
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
</string>
|
||||
<key>License</key>
|
||||
<string>MIT</string>
|
||||
<key>Title</key>
|
||||
<string>WebViewJavascriptBridge</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Generated by CocoaPods - https://cocoapods.org</string>
|
||||
<key>Title</key>
|
||||
<string></string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>StringsTable</key>
|
||||
<string>Acknowledgements</string>
|
||||
<key>Title</key>
|
||||
<string>Acknowledgements</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,5 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
@interface PodsDummy_Pods_ExampleSwiftApp_iOSTests : NSObject
|
||||
@end
|
||||
@implementation PodsDummy_Pods_ExampleSwiftApp_iOSTests
|
||||
@end
|
@ -0,0 +1,91 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
|
||||
|
||||
install_framework()
|
||||
{
|
||||
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
|
||||
local source="${BUILT_PRODUCTS_DIR}/$1"
|
||||
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
|
||||
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
|
||||
elif [ -r "$1" ]; then
|
||||
local source="$1"
|
||||
fi
|
||||
|
||||
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
if [ -L "${source}" ]; then
|
||||
echo "Symlinked..."
|
||||
source="$(readlink "${source}")"
|
||||
fi
|
||||
|
||||
# use filter instead of exclude so missing patterns dont' throw errors
|
||||
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
|
||||
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
|
||||
|
||||
local basename
|
||||
basename="$(basename -s .framework "$1")"
|
||||
binary="${destination}/${basename}.framework/${basename}"
|
||||
if ! [ -r "$binary" ]; then
|
||||
binary="${destination}/${basename}"
|
||||
fi
|
||||
|
||||
# Strip invalid architectures so "fat" simulator / device frameworks work on device
|
||||
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
|
||||
strip_invalid_archs "$binary"
|
||||
fi
|
||||
|
||||
# Resign the code if required by the build settings to avoid unstable apps
|
||||
code_sign_if_enabled "${destination}/$(basename "$1")"
|
||||
|
||||
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
|
||||
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
|
||||
local swift_runtime_libs
|
||||
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
|
||||
for lib in $swift_runtime_libs; do
|
||||
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
|
||||
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
|
||||
code_sign_if_enabled "${destination}/${lib}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# Signs a framework with the provided identity
|
||||
code_sign_if_enabled() {
|
||||
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
|
||||
# Use the current code_sign_identitiy
|
||||
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
|
||||
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
|
||||
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# Strip invalid architectures
|
||||
strip_invalid_archs() {
|
||||
binary="$1"
|
||||
# Get architectures for current file
|
||||
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
|
||||
stripped=""
|
||||
for arch in $archs; do
|
||||
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
|
||||
# Strip non-valid architectures in-place
|
||||
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
|
||||
stripped="$stripped $arch"
|
||||
fi
|
||||
done
|
||||
if [[ "$stripped" ]]; then
|
||||
echo "Stripped $binary of architectures:$stripped"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
||||
install_framework "$BUILT_PRODUCTS_DIR/WebViewJavascriptBridge/WebViewJavascriptBridge.framework"
|
||||
fi
|
||||
if [[ "$CONFIGURATION" == "Release" ]]; then
|
||||
install_framework "$BUILT_PRODUCTS_DIR/WebViewJavascriptBridge/WebViewJavascriptBridge.framework"
|
||||
fi
|
@ -0,0 +1,96 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
|
||||
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
|
||||
> "$RESOURCES_TO_COPY"
|
||||
|
||||
XCASSET_FILES=()
|
||||
|
||||
case "${TARGETED_DEVICE_FAMILY}" in
|
||||
1,2)
|
||||
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
|
||||
;;
|
||||
1)
|
||||
TARGET_DEVICE_ARGS="--target-device iphone"
|
||||
;;
|
||||
2)
|
||||
TARGET_DEVICE_ARGS="--target-device ipad"
|
||||
;;
|
||||
*)
|
||||
TARGET_DEVICE_ARGS="--target-device mac"
|
||||
;;
|
||||
esac
|
||||
|
||||
install_resource()
|
||||
{
|
||||
if [[ "$1" = /* ]] ; then
|
||||
RESOURCE_PATH="$1"
|
||||
else
|
||||
RESOURCE_PATH="${PODS_ROOT}/$1"
|
||||
fi
|
||||
if [[ ! -e "$RESOURCE_PATH" ]] ; then
|
||||
cat << EOM
|
||||
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
|
||||
EOM
|
||||
exit 1
|
||||
fi
|
||||
case $RESOURCE_PATH in
|
||||
*.storyboard)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
|
||||
;;
|
||||
*.xib)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
|
||||
;;
|
||||
*.framework)
|
||||
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
;;
|
||||
*.xcdatamodel)
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
|
||||
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
|
||||
;;
|
||||
*.xcdatamodeld)
|
||||
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
|
||||
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
|
||||
;;
|
||||
*.xcmappingmodel)
|
||||
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
|
||||
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
|
||||
;;
|
||||
*.xcassets)
|
||||
ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
|
||||
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
|
||||
;;
|
||||
*)
|
||||
echo "$RESOURCE_PATH"
|
||||
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
|
||||
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
fi
|
||||
rm -f "$RESOURCES_TO_COPY"
|
||||
|
||||
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
|
||||
then
|
||||
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
|
||||
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
|
||||
while read line; do
|
||||
if [[ $line != "${PODS_ROOT}*" ]]; then
|
||||
XCASSET_FILES+=("$line")
|
||||
fi
|
||||
done <<<"$OTHER_XCASSETS"
|
||||
|
||||
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
fi
|
@ -0,0 +1,8 @@
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
||||
|
||||
|
||||
FOUNDATION_EXPORT double Pods_ExampleSwiftApp_iOSTestsVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char Pods_ExampleSwiftApp_iOSTestsVersionString[];
|
||||
|
@ -0,0 +1,9 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge/WebViewJavascriptBridge.framework/Headers"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "WebViewJavascriptBridge"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
@ -0,0 +1,6 @@
|
||||
framework module Pods_ExampleSwiftApp_iOSTests {
|
||||
umbrella header "Pods-ExampleSwiftApp-iOSTests-umbrella.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge/WebViewJavascriptBridge.framework/Headers"
|
||||
OTHER_LDFLAGS = $(inherited) -framework "WebViewJavascriptBridge"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
26
Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/Info.plist
generated
Normal file
26
Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/Info.plist
generated
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>6.0.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,5 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
@interface PodsDummy_WebViewJavascriptBridge : NSObject
|
||||
@end
|
||||
@implementation PodsDummy_WebViewJavascriptBridge
|
||||
@end
|
@ -0,0 +1,4 @@
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
||||
|
@ -0,0 +1,11 @@
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
||||
|
||||
#import "WebViewJavascriptBridge.h"
|
||||
#import "WebViewJavascriptBridgeBase.h"
|
||||
#import "WKWebViewJavascriptBridge.h"
|
||||
|
||||
FOUNDATION_EXPORT double WebViewJavascriptBridgeVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char WebViewJavascriptBridgeVersionString[];
|
||||
|
@ -0,0 +1,6 @@
|
||||
framework module WebViewJavascriptBridge {
|
||||
umbrella header "WebViewJavascriptBridge-umbrella.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
|
||||
OTHER_LDFLAGS = -framework "UIKit" -framework "WebKit"
|
||||
PODS_BUILD_DIR = $BUILD_DIR
|
||||
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
|
||||
PODS_ROOT = ${SRCROOT}
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||
SKIP_INSTALL = YES
|
33
Example Apps/ExampleSwiftApp-iOS/echo.html
Normal file
33
Example Apps/ExampleSwiftApp-iOS/echo.html
Normal file
@ -0,0 +1,33 @@
|
||||
<!doctype html>
|
||||
<html><head>
|
||||
</head><body>
|
||||
<p>WebViewJavascriptBridgeTests - echo.html</p>
|
||||
<script>
|
||||
function setupWebViewJavascriptBridge(callback) {
|
||||
if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
|
||||
if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
|
||||
window.WVJBCallbacks = [callback];
|
||||
var WVJBIframe = document.createElement('iframe');
|
||||
WVJBIframe.style.display = 'none';
|
||||
WVJBIframe.src = 'https://__bridge_loaded__';
|
||||
document.documentElement.appendChild(WVJBIframe);
|
||||
setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
|
||||
}
|
||||
|
||||
setupWebViewJavascriptBridge(function(bridge) {
|
||||
bridge.callHandler('Greet', 'Hello world');
|
||||
bridge.registerHandler('echoHandler', function(data, responseCallback) {
|
||||
responseCallback(data)
|
||||
})
|
||||
bridge.registerHandler('jsRcvResponseTest', function(data, responseCallback) {
|
||||
bridge.callHandler('objcEchoToJs', { foo:'bar' }, function(response) {
|
||||
if (response && response.foo == 'bar') {
|
||||
responseCallback("Response from JS")
|
||||
} else {
|
||||
responseCallback("Failed")
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body></html>
|
22
LICENSE
Normal file
22
LICENSE
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright (c) 2011-2015 Marcus Westin, Antoine Lagadec
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
22
Makefile
Normal file
22
Makefile
Normal file
@ -0,0 +1,22 @@
|
||||
test:
|
||||
xcodebuild test -project Tests/WebViewJavascriptBridge.xcodeproj -scheme WebViewJavascriptBridge \
|
||||
-destination 'platform=iOS Simulator,name=iPhone 8'
|
||||
xcodebuild test -workspace Example\ Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS.xcworkspace -scheme ExampleSwiftApp-iOS \
|
||||
-destination 'platform=iOS Simulator,name=iPhone 8'
|
||||
|
||||
test-many:
|
||||
xcodebuild test -project Tests/WebViewJavascriptBridge.xcodeproj -scheme WebViewJavascriptBridge \
|
||||
-destination 'platform=iOS Simulator,name=iPhone 6' \
|
||||
-destination 'platform=iOS Simulator,name=iPhone 7' \
|
||||
-destination 'platform=iOS Simulator,name=iPhone 8'
|
||||
|
||||
test-circle-ci:
|
||||
xcodebuild test -project Tests/WebViewJavascriptBridge.xcodeproj -scheme WebViewJavascriptBridge \
|
||||
-destination 'platform=iOS Simulator,name=iPhone 7,OS=10.3.1' \
|
||||
-destination 'platform=iOS Simulator,name=iPhone X,OS=11.0.1'
|
||||
|
||||
|
||||
publish-pod:
|
||||
# pod trunk register narcvs@gmail.com 'Marcus Westin' --description='MBA/MBP-xyz'
|
||||
# First, bump podspec version, then commit & create tag: `git tag -a "v5.X.Y" -m "Tag v5.X.Y" && git push --tags`
|
||||
pod trunk push --verbose WebViewJavascriptBridge.podspec
|
238
README.md
Normal file
238
README.md
Normal file
@ -0,0 +1,238 @@
|
||||
WebViewJavascriptBridge
|
||||
=======================
|
||||
|
||||
[](https://circleci.com/gh/marcuswestin/WebViewJavascriptBridge)
|
||||
|
||||
An iOS/OSX bridge for sending messages between Obj-C and JavaScript in WKWebViews, UIWebViews & WebViews.
|
||||
|
||||
Migration Guide
|
||||
---------------
|
||||
|
||||
When upgrading from v5.0.x to 6.0.x you will have to update the `setupWebViewJavascriptBridge` javascript snippet. See https://github.com/marcuswestin/WebViewJavascriptBridge#usage part 4).
|
||||
|
||||
Who uses WebViewJavascriptBridge?
|
||||
---------------------------------
|
||||
WebViewJavascriptBridge is used by a range of companies and projects. This is a small and incomplete sample list:
|
||||
|
||||
- [Facebook Messenger](https://www.facebook.com/mobile/messenger)
|
||||
- [Facebook Paper](https://facebook.com/paper)
|
||||
- [Yardsale](http://www.getyardsale.com/)
|
||||
- [EverTrue](http://www.evertrue.com/)
|
||||
- [Game Insight](http://www.game-insight.com/)
|
||||
- [Sush.io](http://www.sush.io)
|
||||
- [Imbed](http://imbed.github.io/)
|
||||
- [CareZone](https://carezone.com)
|
||||
- [Hemlig](http://www.hemlig.co)
|
||||
- [Altralogica](http://www.altralogica.it)
|
||||
- [鼎盛中华](https://itunes.apple.com/us/app/ding-sheng-zhong-hua/id537273940?mt=8)
|
||||
- [FRIL](https://fril.jp)
|
||||
- [留白·WHITE](http://liubaiapp.com)
|
||||
- [BrowZine](http://thirdiron.com/browzine/)
|
||||
- ... & many more!
|
||||
|
||||
Installation (iOS & OSX)
|
||||
------------------------
|
||||
|
||||
### Installation with CocoaPods
|
||||
Add this to your [podfile](https://guides.cocoapods.org/using/getting-started.html) and run `pod install` to install:
|
||||
|
||||
```ruby
|
||||
pod 'WebViewJavascriptBridge', '~> 6.0'
|
||||
```
|
||||
|
||||
### Manual installation
|
||||
|
||||
Drag the `WebViewJavascriptBridge` folder into your project.
|
||||
|
||||
In the dialog that appears, uncheck "Copy items into destination group's folder" and select "Create groups for any folders".
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
See the `Example Apps/` folder. Open either the iOS or OSX project and hit run to see it in action.
|
||||
|
||||
To use a WebViewJavascriptBridge in your own project:
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
1) Import the header file and declare an ivar property:
|
||||
|
||||
```objc
|
||||
#import "WebViewJavascriptBridge.h"
|
||||
```
|
||||
|
||||
...
|
||||
|
||||
```objc
|
||||
@property WebViewJavascriptBridge* bridge;
|
||||
```
|
||||
|
||||
2) Instantiate WebViewJavascriptBridge with a WKWebView, UIWebView (iOS) or WebView (OSX):
|
||||
|
||||
```objc
|
||||
self.bridge = [WebViewJavascriptBridge bridgeForWebView:webView];
|
||||
```
|
||||
|
||||
3) Register a handler in ObjC, and call a JS handler:
|
||||
|
||||
```objc
|
||||
[self.bridge registerHandler:@"ObjC Echo" handler:^(id data, WVJBResponseCallback responseCallback) {
|
||||
NSLog(@"ObjC Echo called with: %@", data);
|
||||
responseCallback(data);
|
||||
}];
|
||||
[self.bridge callHandler:@"JS Echo" data:nil responseCallback:^(id responseData) {
|
||||
NSLog(@"ObjC received response: %@", responseData);
|
||||
}];
|
||||
```
|
||||
|
||||
4) Copy and paste `setupWebViewJavascriptBridge` into your JS:
|
||||
|
||||
```javascript
|
||||
function setupWebViewJavascriptBridge(callback) {
|
||||
if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
|
||||
if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
|
||||
window.WVJBCallbacks = [callback];
|
||||
var WVJBIframe = document.createElement('iframe');
|
||||
WVJBIframe.style.display = 'none';
|
||||
WVJBIframe.src = 'https://__bridge_loaded__';
|
||||
document.documentElement.appendChild(WVJBIframe);
|
||||
setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
|
||||
}
|
||||
```
|
||||
|
||||
5) Finally, call `setupWebViewJavascriptBridge` and then use the bridge to register handlers and call ObjC handlers:
|
||||
|
||||
```javascript
|
||||
setupWebViewJavascriptBridge(function(bridge) {
|
||||
|
||||
/* Initialize your app here */
|
||||
|
||||
bridge.registerHandler('JS Echo', function(data, responseCallback) {
|
||||
console.log("JS Echo called with:", data)
|
||||
responseCallback(data)
|
||||
})
|
||||
bridge.callHandler('ObjC Echo', {'key':'value'}, function responseCallback(responseData) {
|
||||
console.log("JS received response:", responseData)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
Automatic reference counting (ARC)
|
||||
----------------------------------
|
||||
This library relies on ARC, so if you use ARC in you project, all works fine.
|
||||
But if your project have no ARC support, be sure to do next steps:
|
||||
|
||||
1) In your Xcode project open project settings -> 'Build Phases'
|
||||
|
||||
2) Expand 'Compile Sources' header and find all *.m files which are belongs to this library. Make attention on the 'Compiler Flags' in front of each source file in this list
|
||||
|
||||
3) For each file add '-fobjc-arc' flag
|
||||
|
||||
Now all WVJB files will be compiled with ARC support.
|
||||
|
||||
Contributors & Forks
|
||||
--------------------
|
||||
Contributors: https://github.com/marcuswestin/WebViewJavascriptBridge/graphs/contributors
|
||||
|
||||
Forks: https://github.com/marcuswestin/WebViewJavascriptBridge/network/members
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
### ObjC API
|
||||
|
||||
##### `[WebViewJavascriptBridge bridgeForWebView:(WKWebVIew/UIWebView/WebView*)webview`
|
||||
|
||||
Create a javascript bridge for the given web view.
|
||||
|
||||
Example:
|
||||
|
||||
```objc
|
||||
[WebViewJavascriptBridge bridgeForWebView:webView];
|
||||
```
|
||||
|
||||
##### `[bridge registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler]`
|
||||
|
||||
Register a handler called `handlerName`. The javascript can then call this handler with `WebViewJavascriptBridge.callHandler("handlerName")`.
|
||||
|
||||
Example:
|
||||
|
||||
```objc
|
||||
[self.bridge registerHandler:@"getScreenHeight" handler:^(id data, WVJBResponseCallback responseCallback) {
|
||||
responseCallback([NSNumber numberWithInt:[UIScreen mainScreen].bounds.size.height]);
|
||||
}];
|
||||
[self.bridge registerHandler:@"log" handler:^(id data, WVJBResponseCallback responseCallback) {
|
||||
NSLog(@"Log: %@", data);
|
||||
}];
|
||||
|
||||
```
|
||||
|
||||
##### `[bridge callHandler:(NSString*)handlerName data:(id)data]`
|
||||
##### `[bridge callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)callback]`
|
||||
|
||||
Call the javascript handler called `handlerName`. If a `responseCallback` block is given the javascript handler can respond.
|
||||
|
||||
Example:
|
||||
|
||||
```objc
|
||||
[self.bridge callHandler:@"showAlert" data:@"Hi from ObjC to JS!"];
|
||||
[self.bridge callHandler:@"getCurrentPageUrl" data:nil responseCallback:^(id responseData) {
|
||||
NSLog(@"Current UIWebView page URL is: %@", responseData);
|
||||
}];
|
||||
```
|
||||
|
||||
#### `[bridge setWebViewDelegate:(id)webViewDelegate]`
|
||||
|
||||
Optionally, set a `WKNavigationDelegate/UIWebViewDelegate` if you need to respond to the [web view's lifecycle events](https://developer.apple.com/reference/uikit/uiwebviewdelegate).
|
||||
|
||||
##### `[bridge disableJavscriptAlertBoxSafetyTimeout]`
|
||||
|
||||
UNSAFE. Speed up bridge message passing by disabling the setTimeout safety check. It is only safe to disable this safety check if you do not call any of the javascript popup box functions (alert, confirm, and prompt). If you call any of these functions from the bridged javascript code, the app will hang.
|
||||
|
||||
Example:
|
||||
|
||||
[self.bridge disableJavscriptAlertBoxSafetyTimeout];
|
||||
|
||||
|
||||
|
||||
### Javascript API
|
||||
|
||||
##### `bridge.registerHandler("handlerName", function(responseData) { ... })`
|
||||
|
||||
Register a handler called `handlerName`. The ObjC can then call this handler with `[bridge callHandler:"handlerName" data:@"Foo"]` and `[bridge callHandler:"handlerName" data:@"Foo" responseCallback:^(id responseData) { ... }]`
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
bridge.registerHandler("showAlert", function(data) { alert(data) })
|
||||
bridge.registerHandler("getCurrentPageUrl", function(data, responseCallback) {
|
||||
responseCallback(document.location.toString())
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
##### `bridge.callHandler("handlerName", data)`
|
||||
##### `bridge.callHandler("handlerName", data, function responseCallback(responseData) { ... })`
|
||||
|
||||
Call an ObjC handler called `handlerName`. If a `responseCallback` function is given the ObjC handler can respond.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
bridge.callHandler("Log", "Foo")
|
||||
bridge.callHandler("getScreenHeight", null, function(response) {
|
||||
alert('Screen height:' + response)
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
##### `bridge.disableJavscriptAlertBoxSafetyTimeout()`
|
||||
|
||||
Calling `bridge.disableJavscriptAlertBoxSafetyTimeout()` has the same effect as calling `[bridge disableJavscriptAlertBoxSafetyTimeout];` in ObjC.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
bridge.disableJavscriptAlertBoxSafetyTimeout()
|
||||
```
|
105
Roadmap.md
Normal file
105
Roadmap.md
Normal file
@ -0,0 +1,105 @@
|
||||
Roadmap
|
||||
=======
|
||||
###通过使用该库可以轻松实现JS与原生交互。
|
||||
|
||||
Issues
|
||||
------
|
||||
|
||||
- [X] `make test` fails becuase the command line invocation can't find WebKit framework. Fix.
|
||||
- [ ] Sometimes tests randomly fail! Race condition...
|
||||
- [X] Add WKWebView support to podspec file? (#149)
|
||||
- [ ] iOS8 WKWebView support? (#126)
|
||||
- [ ] WKWebView issue in OSX? (#84)
|
||||
- [ ] Release new version (#143, #155, #167)
|
||||
- [ ] Optional alert-unsafe message speedup (PR #133, I #132)
|
||||
- [ ] Swift and WKWebView (#153, #158)
|
||||
- [ ] Misc fixes
|
||||
- [ ] Crash on _deserializeMessageJSON (I #159)
|
||||
- [ ] Memory leak? (I #144)
|
||||
- [ ] Pictures/_dispatchMessage queue issue? (I #137)
|
||||
- [ ] Consider making webpage reloads easier (I #134)
|
||||
- [ ] Fix use in $(document).ready (I #131)
|
||||
- [ ] Error message on missing handler (I #120)
|
||||
- [ ] Pending bug repro/info
|
||||
- [ ] #123: unity3d and WebViewJavascriptBridge unrecognized selector sent to instance
|
||||
- [ ] #124: Getting an exception during _flushMessageQueue
|
||||
|
||||
Misc
|
||||
----
|
||||
|
||||
- [ ] Clean up webview delegate - can we get away without passing through one now?
|
||||
- [ ] Make bridge a subclass of UI/WKWebView
|
||||
- [ ] Scrap UIWebView?
|
||||
- [ ] Style consistency through all code
|
||||
- [ ] Test pod
|
||||
- [X] Fix OSX lint warnings (`pod spec lint`)
|
||||
- [X] I believe `receiveMessageQueue` in JS is no longer needed, since the JS explicitly tells ObjC when to start sending messages. Remove?
|
||||
|
||||
v5.0.1
|
||||
------
|
||||
|
||||
Pull requests:
|
||||
- [X] Dev env / docs
|
||||
- [X] Automated tests (PR #128, I #151)
|
||||
- [X] Travis? https://github.com/integrations/feature/code
|
||||
- [X] Embed js in objc source (PR #129)
|
||||
- [X] Also fixes PR #138, I #160, I #108
|
||||
- [X] Docs for podfile installation (PR #140)
|
||||
- [X] Improve API
|
||||
- [X] Remove default bridge handler - just do command/response. Remove bridge.init
|
||||
- [X] Features & fixes to consider
|
||||
- [X] Message response timeout (PR #106)
|
||||
- [X] Remove or fix numRequestsLoading (PR #146, PR #157)
|
||||
- [X] Net load fixes
|
||||
- [X] Fix `[webView stopLoading]` (PR #168, I #163)
|
||||
- [x] Detect offline failed requests (PR #170)
|
||||
- [X] Handle redirects (PR #172)
|
||||
- [X] Bridge never initiates without a didLoad (I #156)
|
||||
|
||||
Future considerations
|
||||
---------------------
|
||||
- [ ] Swift
|
||||
- [ ] Swift examples (I #173)
|
||||
- [ ] Javascript
|
||||
- [ ] Cookie set in client is not sent (I #171)
|
||||
- [ ] Form submission error (I #169)
|
||||
- [ ] React Native
|
||||
- [ ] Example app (I #162)
|
||||
- [ ] New features to consider
|
||||
- [ ] Multiple handlers: pubsub (I #119)
|
||||
- [ ] Remove handlers (I #118)
|
||||
- [ ] Other platforms to consider
|
||||
- [ ] Android - partly done by @fangj (#103)
|
||||
- [ ] Chrome - partly done by @fangj (#104)
|
||||
- [ ] Windows phone
|
||||
|
||||
|
||||
Common Messages
|
||||
---------------
|
||||
|
||||
#### Fixed in v5.x.y:
|
||||
|
||||
Hi!
|
||||
|
||||
I believe this may be fixed in v5.0.1.
|
||||
|
||||
When you switch to the new version, please note that the API has changed. In particular, make sure that you use the javascript setup code, as it has changed: https://github.com/marcuswestin/WebViewJavascriptBridge#usage
|
||||
|
||||
If you are still having trouble when using v5.0.x, feel free to reopen.
|
||||
|
||||
Cheers!
|
||||
|
||||
|
||||
#### Need repro:
|
||||
|
||||
Hi!
|
||||
|
||||
Without a repro I won't be able to help you :(
|
||||
|
||||
If you create a PR with a failing test then I will definitely give you a hand (see https://github.com/marcuswestin/WebViewJavascriptBridge/blob/master/Tests/WebViewJavascriptBridgeTests/BridgeTests.m and https://github.com/marcuswestin/WebViewJavascriptBridge/blob/master/Tests/WebViewJavascriptBridgeTests/echo.html).
|
||||
|
||||
You could also create a PR with an example in `Example Apps` with the problem you're seeing in - that would definitely help me help you :)
|
||||
|
||||
I'll close this in the meantime since there's nothing I can do. Feel free to reopen with a repro or more information.
|
||||
|
||||
Cheers!
|
BIN
Tests/Default-568h@2x.png
Normal file
BIN
Tests/Default-568h@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
489
Tests/WebViewJavascriptBridge.xcodeproj/project.pbxproj
Normal file
489
Tests/WebViewJavascriptBridge.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,489 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2C35E9761C5A7F8E0093FB29 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2C35E9751C5A7F8E0093FB29 /* Default-568h@2x.png */; };
|
||||
2C3E7C631C5A928700A1E322 /* WebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C3E7C5C1C5A928700A1E322 /* WebViewJavascriptBridge.m */; };
|
||||
2C3E7C641C5A928700A1E322 /* WebViewJavascriptBridge_JS.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C3E7C5E1C5A928700A1E322 /* WebViewJavascriptBridge_JS.m */; };
|
||||
2C3E7C651C5A928700A1E322 /* WebViewJavascriptBridgeBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C3E7C601C5A928700A1E322 /* WebViewJavascriptBridgeBase.m */; };
|
||||
2C3E7C661C5A928700A1E322 /* WKWebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C3E7C621C5A928700A1E322 /* WKWebViewJavascriptBridge.m */; };
|
||||
2C52B1E21E11858800517DAF /* BridgeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C52B1E11E11858800517DAF /* BridgeTests.swift */; };
|
||||
2C864FFD1C60FC8A00954B70 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C864FFC1C60FC8A00954B70 /* WebKit.framework */; };
|
||||
3D99867E1AE2A3B2001DDA2C /* echo.html in Resources */ = {isa = PBXBuildFile; fileRef = 3D99867D1AE2A3B2001DDA2C /* echo.html */; };
|
||||
3D9E5F2F1AE288E5009D1C36 /* BridgeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D9E5F2E1AE288E5009D1C36 /* BridgeTests.m */; };
|
||||
3DCCF7DB1AE28C2900CE7C51 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DCCF7DA1AE28C2900CE7C51 /* main.m */; };
|
||||
3DCCF7DE1AE28C2900CE7C51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DCCF7DD1AE28C2900CE7C51 /* AppDelegate.m */; };
|
||||
3DCCF8021AE2911100CE7C51 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DCCF8011AE2911100CE7C51 /* UIKit.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
3DCCF7FC1AE28C3B00CE7C51 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 3D0FE4621AE2886400BB4104 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 3DCCF7D51AE28C2900CE7C51;
|
||||
remoteInfo = WebViewJavascriptBridgeTestHost;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2C35E9751C5A7F8E0093FB29 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
|
||||
2C3E7C5B1C5A928700A1E322 /* WebViewJavascriptBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge.h; sourceTree = "<group>"; };
|
||||
2C3E7C5C1C5A928700A1E322 /* WebViewJavascriptBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge.m; sourceTree = "<group>"; };
|
||||
2C3E7C5D1C5A928700A1E322 /* WebViewJavascriptBridge_JS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge_JS.h; sourceTree = "<group>"; };
|
||||
2C3E7C5E1C5A928700A1E322 /* WebViewJavascriptBridge_JS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge_JS.m; sourceTree = "<group>"; };
|
||||
2C3E7C5F1C5A928700A1E322 /* WebViewJavascriptBridgeBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridgeBase.h; sourceTree = "<group>"; };
|
||||
2C3E7C601C5A928700A1E322 /* WebViewJavascriptBridgeBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridgeBase.m; sourceTree = "<group>"; };
|
||||
2C3E7C611C5A928700A1E322 /* WKWebViewJavascriptBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewJavascriptBridge.h; sourceTree = "<group>"; };
|
||||
2C3E7C621C5A928700A1E322 /* WKWebViewJavascriptBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKWebViewJavascriptBridge.m; sourceTree = "<group>"; };
|
||||
2C52B1E01E11858800517DAF /* WebViewJavascriptBridgeTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WebViewJavascriptBridgeTests-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
2C52B1E11E11858800517DAF /* BridgeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BridgeTests.swift; sourceTree = "<group>"; };
|
||||
2C864FFC1C60FC8A00954B70 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
|
||||
3D0FE4751AE2886500BB4104 /* WebViewJavascriptBridgeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebViewJavascriptBridgeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3D0FE47B1AE2886500BB4104 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
3D99867D1AE2A3B2001DDA2C /* echo.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = echo.html; path = WebViewJavascriptBridgeTests/echo.html; sourceTree = SOURCE_ROOT; };
|
||||
3D9E5F2E1AE288E5009D1C36 /* BridgeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BridgeTests.m; sourceTree = "<group>"; };
|
||||
3DCCF7D61AE28C2900CE7C51 /* WebViewJavascriptBridgeTestHost.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WebViewJavascriptBridgeTestHost.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3DCCF7D91AE28C2900CE7C51 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
3DCCF7DA1AE28C2900CE7C51 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
3DCCF7DC1AE28C2900CE7C51 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
3DCCF7DD1AE28C2900CE7C51 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
3DCCF8011AE2911100CE7C51 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
3D0FE4721AE2886500BB4104 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2C864FFD1C60FC8A00954B70 /* WebKit.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3DCCF7D31AE28C2900CE7C51 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
3DCCF8021AE2911100CE7C51 /* UIKit.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2C3E7C5A1C5A928700A1E322 /* WebViewJavascriptBridge */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2C3E7C5B1C5A928700A1E322 /* WebViewJavascriptBridge.h */,
|
||||
2C3E7C5C1C5A928700A1E322 /* WebViewJavascriptBridge.m */,
|
||||
2C3E7C5D1C5A928700A1E322 /* WebViewJavascriptBridge_JS.h */,
|
||||
2C3E7C5E1C5A928700A1E322 /* WebViewJavascriptBridge_JS.m */,
|
||||
2C3E7C5F1C5A928700A1E322 /* WebViewJavascriptBridgeBase.h */,
|
||||
2C3E7C601C5A928700A1E322 /* WebViewJavascriptBridgeBase.m */,
|
||||
2C3E7C611C5A928700A1E322 /* WKWebViewJavascriptBridge.h */,
|
||||
2C3E7C621C5A928700A1E322 /* WKWebViewJavascriptBridge.m */,
|
||||
);
|
||||
name = WebViewJavascriptBridge;
|
||||
path = ../WebViewJavascriptBridge;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3D0FE4611AE2886400BB4104 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2C864FFC1C60FC8A00954B70 /* WebKit.framework */,
|
||||
2C35E9751C5A7F8E0093FB29 /* Default-568h@2x.png */,
|
||||
2C3E7C5A1C5A928700A1E322 /* WebViewJavascriptBridge */,
|
||||
3D0FE4791AE2886500BB4104 /* WebViewJavascriptBridgeTests */,
|
||||
3DCCF7D71AE28C2900CE7C51 /* WebViewJavascriptBridgeTestHost */,
|
||||
3D0FE46B1AE2886400BB4104 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3D0FE46B1AE2886400BB4104 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3D0FE4751AE2886500BB4104 /* WebViewJavascriptBridgeTests.xctest */,
|
||||
3DCCF7D61AE28C2900CE7C51 /* WebViewJavascriptBridgeTestHost.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3D0FE4791AE2886500BB4104 /* WebViewJavascriptBridgeTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3D0FE47A1AE2886500BB4104 /* Supporting Files */,
|
||||
3D9E5F2E1AE288E5009D1C36 /* BridgeTests.m */,
|
||||
2C52B1E11E11858800517DAF /* BridgeTests.swift */,
|
||||
2C52B1E01E11858800517DAF /* WebViewJavascriptBridgeTests-Bridging-Header.h */,
|
||||
);
|
||||
path = WebViewJavascriptBridgeTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3D0FE47A1AE2886500BB4104 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3D0FE47B1AE2886500BB4104 /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3DCCF7D71AE28C2900CE7C51 /* WebViewJavascriptBridgeTestHost */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3DCCF7DC1AE28C2900CE7C51 /* AppDelegate.h */,
|
||||
3DCCF7DD1AE28C2900CE7C51 /* AppDelegate.m */,
|
||||
3DCCF8031AE2911700CE7C51 /* Frameworks */,
|
||||
3DCCF7D81AE28C2900CE7C51 /* Supporting Files */,
|
||||
);
|
||||
path = WebViewJavascriptBridgeTestHost;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3DCCF7D81AE28C2900CE7C51 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3D99867D1AE2A3B2001DDA2C /* echo.html */,
|
||||
3DCCF7D91AE28C2900CE7C51 /* Info.plist */,
|
||||
3DCCF7DA1AE28C2900CE7C51 /* main.m */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3DCCF8031AE2911700CE7C51 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3DCCF8011AE2911100CE7C51 /* UIKit.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
3D0FE4741AE2886500BB4104 /* WebViewJavascriptBridgeTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 3D0FE4811AE2886500BB4104 /* Build configuration list for PBXNativeTarget "WebViewJavascriptBridgeTests" */;
|
||||
buildPhases = (
|
||||
3D0FE4711AE2886500BB4104 /* Sources */,
|
||||
3D0FE4721AE2886500BB4104 /* Frameworks */,
|
||||
3D0FE4731AE2886500BB4104 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
3DCCF7FD1AE28C3B00CE7C51 /* PBXTargetDependency */,
|
||||
);
|
||||
name = WebViewJavascriptBridgeTests;
|
||||
productName = WebViewJavascriptBridgeTests;
|
||||
productReference = 3D0FE4751AE2886500BB4104 /* WebViewJavascriptBridgeTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
3DCCF7D51AE28C2900CE7C51 /* WebViewJavascriptBridgeTestHost */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 3DCCF7FA1AE28C2900CE7C51 /* Build configuration list for PBXNativeTarget "WebViewJavascriptBridgeTestHost" */;
|
||||
buildPhases = (
|
||||
3DCCF7D21AE28C2900CE7C51 /* Sources */,
|
||||
3DCCF7D31AE28C2900CE7C51 /* Frameworks */,
|
||||
3DCCF7D41AE28C2900CE7C51 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = WebViewJavascriptBridgeTestHost;
|
||||
productName = WebViewJavascriptBridgeTestHost;
|
||||
productReference = 3DCCF7D61AE28C2900CE7C51 /* WebViewJavascriptBridgeTestHost.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
3D0FE4621AE2886400BB4104 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0900;
|
||||
ORGANIZATIONNAME = marcuswestin;
|
||||
TargetAttributes = {
|
||||
3D0FE4741AE2886500BB4104 = {
|
||||
CreatedOnToolsVersion = 6.3;
|
||||
LastSwiftMigration = 0900;
|
||||
TestTargetID = 3DCCF7D51AE28C2900CE7C51;
|
||||
};
|
||||
3DCCF7D51AE28C2900CE7C51 = {
|
||||
CreatedOnToolsVersion = 6.3;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 3D0FE4651AE2886400BB4104 /* Build configuration list for PBXProject "WebViewJavascriptBridge" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 3D0FE4611AE2886400BB4104;
|
||||
productRefGroup = 3D0FE46B1AE2886400BB4104 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
3D0FE4741AE2886500BB4104 /* WebViewJavascriptBridgeTests */,
|
||||
3DCCF7D51AE28C2900CE7C51 /* WebViewJavascriptBridgeTestHost */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
3D0FE4731AE2886500BB4104 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3DCCF7D41AE28C2900CE7C51 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
3D99867E1AE2A3B2001DDA2C /* echo.html in Resources */,
|
||||
2C35E9761C5A7F8E0093FB29 /* Default-568h@2x.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
3D0FE4711AE2886500BB4104 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2C3E7C651C5A928700A1E322 /* WebViewJavascriptBridgeBase.m in Sources */,
|
||||
2C3E7C661C5A928700A1E322 /* WKWebViewJavascriptBridge.m in Sources */,
|
||||
3D9E5F2F1AE288E5009D1C36 /* BridgeTests.m in Sources */,
|
||||
2C3E7C631C5A928700A1E322 /* WebViewJavascriptBridge.m in Sources */,
|
||||
2C52B1E21E11858800517DAF /* BridgeTests.swift in Sources */,
|
||||
2C3E7C641C5A928700A1E322 /* WebViewJavascriptBridge_JS.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3DCCF7D21AE28C2900CE7C51 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
3DCCF7DE1AE28C2900CE7C51 /* AppDelegate.m in Sources */,
|
||||
3DCCF7DB1AE28C2900CE7C51 /* main.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
3DCCF7FD1AE28C3B00CE7C51 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 3DCCF7D51AE28C2900CE7C51 /* WebViewJavascriptBridgeTestHost */;
|
||||
targetProxy = 3DCCF7FC1AE28C3B00CE7C51 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
3D0FE47C1AE2886500BB4104 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
3D0FE47D1AE2886500BB4104 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
3D0FE4821AE2886500BB4104 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = WebViewJavascriptBridgeTests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "in.marcuswestin.WebViewJavascriptBridge.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "WebViewJavascriptBridgeTests/WebViewJavascriptBridgeTests-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WebViewJavascriptBridgeTestHost.app/WebViewJavascriptBridgeTestHost";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
3D0FE4831AE2886500BB4104 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
|
||||
INFOPLIST_FILE = WebViewJavascriptBridgeTests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "in.marcuswestin.WebViewJavascriptBridge.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "WebViewJavascriptBridgeTests/WebViewJavascriptBridgeTests-Bridging-Header.h";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WebViewJavascriptBridgeTestHost.app/WebViewJavascriptBridgeTestHost";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
3DCCF7F61AE28C2900CE7C51 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = WebViewJavascriptBridgeTestHost/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "in.marcuswestin.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
3DCCF7F71AE28C2900CE7C51 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
INFOPLIST_FILE = WebViewJavascriptBridgeTestHost/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "in.marcuswestin.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
3D0FE4651AE2886400BB4104 /* Build configuration list for PBXProject "WebViewJavascriptBridge" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
3D0FE47C1AE2886500BB4104 /* Debug */,
|
||||
3D0FE47D1AE2886500BB4104 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
3D0FE4811AE2886500BB4104 /* Build configuration list for PBXNativeTarget "WebViewJavascriptBridgeTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
3D0FE4821AE2886500BB4104 /* Debug */,
|
||||
3D0FE4831AE2886500BB4104 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
3DCCF7FA1AE28C2900CE7C51 /* Build configuration list for PBXNativeTarget "WebViewJavascriptBridgeTestHost" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
3DCCF7F61AE28C2900CE7C51 /* Debug */,
|
||||
3DCCF7F71AE28C2900CE7C51 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 3D0FE4621AE2886400BB4104 /* Project object */;
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3D0FE4691AE2886400BB4104"
|
||||
BuildableName = "libWebViewJavascriptBridge.a"
|
||||
BlueprintName = "WebViewJavascriptBridge"
|
||||
ReferencedContainer = "container:WebViewJavascriptBridge.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "NO"
|
||||
buildForArchiving = "NO"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3D0FE4741AE2886500BB4104"
|
||||
BuildableName = "WebViewJavascriptBridgeTests.xctest"
|
||||
BlueprintName = "WebViewJavascriptBridgeTests"
|
||||
ReferencedContainer = "container:WebViewJavascriptBridge.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3D0FE4741AE2886500BB4104"
|
||||
BuildableName = "WebViewJavascriptBridgeTests.xctest"
|
||||
BlueprintName = "WebViewJavascriptBridgeTests"
|
||||
ReferencedContainer = "container:WebViewJavascriptBridge.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3D0FE4691AE2886400BB4104"
|
||||
BuildableName = "libWebViewJavascriptBridge.a"
|
||||
BlueprintName = "WebViewJavascriptBridge"
|
||||
ReferencedContainer = "container:WebViewJavascriptBridge.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3D0FE4691AE2886400BB4104"
|
||||
BuildableName = "libWebViewJavascriptBridge.a"
|
||||
BlueprintName = "WebViewJavascriptBridge"
|
||||
ReferencedContainer = "container:WebViewJavascriptBridge.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3D0FE4691AE2886400BB4104"
|
||||
BuildableName = "libWebViewJavascriptBridge.a"
|
||||
BlueprintName = "WebViewJavascriptBridge"
|
||||
ReferencedContainer = "container:WebViewJavascriptBridge.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
16
Tests/WebViewJavascriptBridgeTestHost/AppDelegate.h
Normal file
16
Tests/WebViewJavascriptBridgeTestHost/AppDelegate.h
Normal file
@ -0,0 +1,16 @@
|
||||
//
|
||||
// AppDelegate.h
|
||||
// WebViewJavascriptBridgeTestHost
|
||||
//
|
||||
// Created by Pieter De Baets on 18/04/2015.
|
||||
// Copyright (c) 2015 marcuswestin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@end
|
||||
|
43
Tests/WebViewJavascriptBridgeTestHost/AppDelegate.m
Normal file
43
Tests/WebViewJavascriptBridgeTestHost/AppDelegate.m
Normal file
@ -0,0 +1,43 @@
|
||||
//
|
||||
// AppDelegate.m
|
||||
// WebViewJavascriptBridgeTestHost
|
||||
//
|
||||
// Created by Pieter De Baets on 18/04/2015.
|
||||
// Copyright (c) 2015 marcuswestin. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
self.window.rootViewController = [UIViewController new];
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication *)application {
|
||||
// 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.
|
||||
// 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.
|
||||
}
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application {
|
||||
// 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.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application {
|
||||
// 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.
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
// 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.
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
@end
|
34
Tests/WebViewJavascriptBridgeTestHost/Info.plist
Normal file
34
Tests/WebViewJavascriptBridgeTestHost/Info.plist
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,13 @@
|
||||
//
|
||||
// AppDelegate-Bridging-Header.h
|
||||
// WebViewJavascriptBridge
|
||||
//
|
||||
// Created by John Marcus Westin on 12/27/16.
|
||||
// Copyright © 2016 marcuswestin. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef AppDelegate_Bridging_Header_h
|
||||
#define AppDelegate_Bridging_Header_h
|
||||
|
||||
|
||||
#endif /* AppDelegate_Bridging_Header_h */
|
16
Tests/WebViewJavascriptBridgeTestHost/main.m
Normal file
16
Tests/WebViewJavascriptBridgeTestHost/main.m
Normal file
@ -0,0 +1,16 @@
|
||||
//
|
||||
// main.m
|
||||
// WebViewJavascriptBridgeTestHost
|
||||
//
|
||||
// Created by Pieter De Baets on 18/04/2015.
|
||||
// Copyright (c) 2015 marcuswestin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "AppDelegate.h"
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
||||
}
|
||||
}
|
183
Tests/WebViewJavascriptBridgeTests/BridgeTests.m
Normal file
183
Tests/WebViewJavascriptBridgeTests/BridgeTests.m
Normal file
@ -0,0 +1,183 @@
|
||||
//
|
||||
// BridgeTests.m
|
||||
// WKWebViewJavascriptBridge
|
||||
//
|
||||
// Created by Pieter De Baets on 18/04/2015.
|
||||
// Copyright (c) 2015 marcuswestin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
#import "WebViewJavascriptBridge.h"
|
||||
#import "AppDelegate.h"
|
||||
|
||||
static NSString *const echoHandler = @"echoHandler";
|
||||
|
||||
@interface BridgeTests : XCTestCase
|
||||
@end
|
||||
@interface TestWebPageLoadDelegate : NSObject<UIWebViewDelegate, WKNavigationDelegate>
|
||||
@property XCTestExpectation* expectation;
|
||||
@end
|
||||
|
||||
@implementation BridgeTests {
|
||||
UIWebView *_uiWebView;
|
||||
WKWebView *_wkWebView;
|
||||
NSMutableArray* _retains;
|
||||
}
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
|
||||
UIViewController *rootVC = [[(AppDelegate *)[[UIApplication sharedApplication] delegate] window] rootViewController];
|
||||
CGRect frame = rootVC.view.bounds;
|
||||
frame.size.height /= 2;
|
||||
_uiWebView = [[UIWebView alloc] initWithFrame:frame];
|
||||
_uiWebView.backgroundColor = [UIColor blueColor];
|
||||
[rootVC.view addSubview:_uiWebView];
|
||||
frame.origin.y += frame.size.height;
|
||||
_wkWebView = [[WKWebView alloc] initWithFrame:frame];
|
||||
_wkWebView.backgroundColor = [UIColor redColor];
|
||||
[rootVC.view addSubview:_wkWebView];
|
||||
|
||||
_retains = [NSMutableArray array];
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
[super tearDown];
|
||||
[_uiWebView removeFromSuperview];
|
||||
[_wkWebView removeFromSuperview];
|
||||
}
|
||||
|
||||
- (WebViewJavascriptBridge*)bridgeForWebView:(id)webView {
|
||||
WebViewJavascriptBridge* bridge = [WebViewJavascriptBridge bridgeForWebView:webView];
|
||||
[_retains addObject:bridge];
|
||||
return bridge;
|
||||
}
|
||||
|
||||
static void loadEchoSample(id webView) {
|
||||
NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"echo" withExtension:@"html"]];
|
||||
[(UIWebView*)webView loadRequest:request];
|
||||
}
|
||||
|
||||
const NSTimeInterval timeoutSec = 5;
|
||||
|
||||
- (void)testEchoHandler {
|
||||
[self classSpecificTestEchoHandler:_uiWebView];
|
||||
[self classSpecificTestEchoHandler:_wkWebView];
|
||||
[self waitForExpectationsWithTimeout:timeoutSec handler:NULL];
|
||||
}
|
||||
- (void)classSpecificTestEchoHandler:(id)webView {
|
||||
WebViewJavascriptBridge *bridge = [self bridgeForWebView:webView];
|
||||
|
||||
XCTestExpectation *callbackInvocked = [self expectationWithDescription:@"Callback invoked"];
|
||||
[bridge callHandler:echoHandler data:@"testEchoHandler" responseCallback:^(id responseData) {
|
||||
XCTAssertEqualObjects(responseData, @"testEchoHandler");
|
||||
[callbackInvocked fulfill];
|
||||
}];
|
||||
|
||||
loadEchoSample(webView);
|
||||
}
|
||||
|
||||
- (void)testEchoHandlerAfterSetup {
|
||||
[self classSpecificTestEchoHandlerAfterSetup:_uiWebView];
|
||||
[self classSpecificTestEchoHandlerAfterSetup:_wkWebView];
|
||||
[self waitForExpectationsWithTimeout:timeoutSec handler:NULL];
|
||||
}
|
||||
- (void)classSpecificTestEchoHandlerAfterSetup:(id)webView {
|
||||
WebViewJavascriptBridge *bridge = [self bridgeForWebView:webView];
|
||||
|
||||
XCTestExpectation *callbackInvocked = [self expectationWithDescription:@"Callback invoked"];
|
||||
loadEchoSample(webView);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 150 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
|
||||
[bridge callHandler:echoHandler data:@"testEchoHandler" responseCallback:^(id responseData) {
|
||||
XCTAssertEqualObjects(responseData, @"testEchoHandler");
|
||||
[callbackInvocked fulfill];
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)testObjectEncoding {
|
||||
[self classSpecificTestObjectEncoding:_uiWebView];
|
||||
[self classSpecificTestObjectEncoding:_wkWebView];
|
||||
[self waitForExpectationsWithTimeout:timeoutSec handler:NULL];
|
||||
}
|
||||
- (void)classSpecificTestObjectEncoding:(id)webView {
|
||||
WebViewJavascriptBridge *bridge = [self bridgeForWebView:webView];
|
||||
|
||||
void (^echoObject)(id) = ^void(id object) {
|
||||
XCTestExpectation *callbackInvocked = [self expectationWithDescription:@"Callback invoked"];
|
||||
[bridge callHandler:echoHandler data:object responseCallback:^(id responseData) {
|
||||
XCTAssertEqualObjects(responseData, object);
|
||||
[callbackInvocked fulfill];
|
||||
}];
|
||||
};
|
||||
|
||||
echoObject(@"A string sent over the wire");
|
||||
echoObject(@"A string with '\"'/\\");
|
||||
echoObject(@[ @1, @2, @3 ]);
|
||||
echoObject(@{ @"a" : @1, @"b" : @2 });
|
||||
|
||||
loadEchoSample(webView);
|
||||
}
|
||||
|
||||
- (void)testJavascriptReceiveResponse {
|
||||
[self classSpecificTestJavascriptReceiveResponse:_uiWebView];
|
||||
[self classSpecificTestJavascriptReceiveResponse:_wkWebView];
|
||||
[self waitForExpectationsWithTimeout:timeoutSec handler:NULL];
|
||||
}
|
||||
- (void)classSpecificTestJavascriptReceiveResponse:(id)webView {
|
||||
WebViewJavascriptBridge *bridge = [self bridgeForWebView:webView];
|
||||
loadEchoSample(webView);
|
||||
XCTestExpectation *callbackInvocked = [self expectationWithDescription:@"Callback invoked"];
|
||||
[bridge registerHandler:@"objcEchoToJs" handler:^(id data, WVJBResponseCallback responseCallback) {
|
||||
responseCallback(data);
|
||||
}];
|
||||
[bridge callHandler:@"jsRcvResponseTest" data:nil responseCallback:^(id responseData) {
|
||||
XCTAssertEqualObjects(responseData, @"Response from JS");
|
||||
[callbackInvocked fulfill];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)testJavascriptReceiveResponseWithoutSafetyTimeout {
|
||||
[self classSpecificTestJavascriptReceiveResponseWithoutSafetyTimeout:_uiWebView];
|
||||
[self classSpecificTestJavascriptReceiveResponseWithoutSafetyTimeout:_wkWebView];
|
||||
[self waitForExpectationsWithTimeout:timeoutSec handler:NULL];
|
||||
}
|
||||
- (void)classSpecificTestJavascriptReceiveResponseWithoutSafetyTimeout:(id)webView {
|
||||
WebViewJavascriptBridge *bridge = [self bridgeForWebView:webView];
|
||||
[bridge disableJavscriptAlertBoxSafetyTimeout];
|
||||
loadEchoSample(webView);
|
||||
XCTestExpectation *callbackInvocked = [self expectationWithDescription:@"Callback invoked"];
|
||||
[bridge registerHandler:@"objcEchoToJs" handler:^(id data, WVJBResponseCallback responseCallback) {
|
||||
responseCallback(data);
|
||||
}];
|
||||
[bridge callHandler:@"jsRcvResponseTest" data:nil responseCallback:^(id responseData) {
|
||||
XCTAssertEqualObjects(responseData, @"Response from JS");
|
||||
[callbackInvocked fulfill];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)testWebpageLoad {
|
||||
[self classSpecificTestWebpageLoad:_uiWebView];
|
||||
[self classSpecificTestWebpageLoad:_wkWebView];
|
||||
[self waitForExpectationsWithTimeout:timeoutSec handler:NULL];
|
||||
}
|
||||
- (void)classSpecificTestWebpageLoad:(id)webView {
|
||||
WebViewJavascriptBridge* bridge = [self bridgeForWebView:webView];
|
||||
TestWebPageLoadDelegate* delegate = [TestWebPageLoadDelegate new];
|
||||
delegate.expectation = [self expectationWithDescription:@"Webpage loaded"];
|
||||
[_retains addObject:delegate];
|
||||
[bridge setWebViewDelegate:delegate];
|
||||
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://example.com"]];
|
||||
[(UIWebView*)webView loadRequest:request];
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation TestWebPageLoadDelegate
|
||||
- (void)webViewDidFinishLoad:(UIWebView *)webView {
|
||||
[self.expectation fulfill];
|
||||
}
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
|
||||
[self.expectation fulfill];
|
||||
}
|
||||
@end
|
35
Tests/WebViewJavascriptBridgeTests/BridgeTests.swift
Normal file
35
Tests/WebViewJavascriptBridgeTests/BridgeTests.swift
Normal file
@ -0,0 +1,35 @@
|
||||
//
|
||||
// BridgeTests.swift
|
||||
// WebViewJavascriptBridge
|
||||
//
|
||||
// Created by John Marcus Westin on 12/26/16.
|
||||
// Copyright © 2016 marcuswestin. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
class BridgeTests: XCTestCase {
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
func testExample() {
|
||||
// This is an example of a functional test case.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
}
|
||||
|
||||
func testPerformanceExample() {
|
||||
// This is an example of a performance test case.
|
||||
self.measure {
|
||||
// Put the code you want to measure the time of here.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
24
Tests/WebViewJavascriptBridgeTests/Info.plist
Normal file
24
Tests/WebViewJavascriptBridgeTests/Info.plist
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,4 @@
|
||||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
32
Tests/WebViewJavascriptBridgeTests/echo.html
Normal file
32
Tests/WebViewJavascriptBridgeTests/echo.html
Normal file
@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<html><head>
|
||||
</head><body>
|
||||
<p>WebViewJavascriptBridgeTests - echo.html</p>
|
||||
<script>
|
||||
function setupWebViewJavascriptBridge(callback) {
|
||||
if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
|
||||
if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
|
||||
window.WVJBCallbacks = [callback];
|
||||
var WVJBIframe = document.createElement('iframe');
|
||||
WVJBIframe.style.display = 'none';
|
||||
WVJBIframe.src = 'https://__bridge_loaded__';
|
||||
document.documentElement.appendChild(WVJBIframe);
|
||||
setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
|
||||
}
|
||||
|
||||
setupWebViewJavascriptBridge(function(bridge) {
|
||||
bridge.registerHandler('echoHandler', function(data, responseCallback) {
|
||||
responseCallback(data)
|
||||
})
|
||||
bridge.registerHandler('jsRcvResponseTest', function(data, responseCallback) {
|
||||
bridge.callHandler('objcEchoToJs', { foo:'bar' }, function(response) {
|
||||
if (response && response.foo == 'bar') {
|
||||
responseCallback("Response from JS")
|
||||
} else {
|
||||
responseCallback("Failed")
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body></html>
|
19
WebViewJavascriptBridge.podspec
Normal file
19
WebViewJavascriptBridge.podspec
Normal file
@ -0,0 +1,19 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'WebViewJavascriptBridge'
|
||||
s.version = '6.0.3'
|
||||
s.summary = 'An iOS & OSX bridge for sending messages between Obj-C/Swift and JavaScript in WKWebViews, UIWebViews & WebViews.'
|
||||
s.homepage = 'https://github.com/marcuswestin/WebViewJavascriptBridge'
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
s.author = { 'marcuswestin' => 'marcus.westin@gmail.com' }
|
||||
s.source = { :git => 'https://git.qinjiu8.com/liuhl/WebViewJavascriptBridge.git', :tag => 'v'+s.version.to_s }
|
||||
s.platforms = { :ios => "5.0", :osx => "" }
|
||||
s.requires_arc = true
|
||||
|
||||
s.ios.source_files = 'WebViewJavascriptBridge/*.{h,m}'
|
||||
s.ios.private_header_files = 'WebViewJavascriptBridge/WebViewJavascriptBridge_JS.h'
|
||||
s.osx.source_files = 'WebViewJavascriptBridge/*.{h,m}'
|
||||
s.osx.private_header_files = 'WebViewJavascriptBridge/WebViewJavascriptBridge_JS.h'
|
||||
|
||||
s.frameworks = 'WebKit'
|
||||
s.ios.frameworks = 'UIKit', 'WebKit'
|
||||
end
|
34
WebViewJavascriptBridge/WKWebViewJavascriptBridge.h
Normal file
34
WebViewJavascriptBridge/WKWebViewJavascriptBridge.h
Normal file
@ -0,0 +1,34 @@
|
||||
//
|
||||
// WKWebViewJavascriptBridge.h
|
||||
//
|
||||
// Created by @LokiMeyburg on 10/15/14.
|
||||
// Copyright (c) 2014 @LokiMeyburg. All rights reserved.
|
||||
//
|
||||
|
||||
#if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_1)
|
||||
#define supportsWKWebView
|
||||
#endif
|
||||
|
||||
#if defined supportsWKWebView
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WebViewJavascriptBridgeBase.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
@interface WKWebViewJavascriptBridge : NSObject<WKNavigationDelegate, WebViewJavascriptBridgeBaseDelegate>
|
||||
|
||||
+ (instancetype)bridgeForWebView:(WKWebView*)webView;
|
||||
+ (void)enableLogging;
|
||||
|
||||
- (void)registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler;
|
||||
- (void)removeHandler:(NSString*)handlerName;
|
||||
- (void)callHandler:(NSString*)handlerName;
|
||||
- (void)callHandler:(NSString*)handlerName data:(id)data;
|
||||
- (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback;
|
||||
- (void)reset;
|
||||
- (void)setWebViewDelegate:(id)webViewDelegate;
|
||||
- (void)disableJavscriptAlertBoxSafetyTimeout;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
198
WebViewJavascriptBridge/WKWebViewJavascriptBridge.m
Normal file
198
WebViewJavascriptBridge/WKWebViewJavascriptBridge.m
Normal file
@ -0,0 +1,198 @@
|
||||
//
|
||||
// WKWebViewJavascriptBridge.m
|
||||
//
|
||||
// Created by @LokiMeyburg on 10/15/14.
|
||||
// Copyright (c) 2014 @LokiMeyburg. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
#import "WKWebViewJavascriptBridge.h"
|
||||
|
||||
#if defined supportsWKWebView
|
||||
|
||||
@implementation WKWebViewJavascriptBridge {
|
||||
__weak WKWebView* _webView;
|
||||
__weak id<WKNavigationDelegate> _webViewDelegate;
|
||||
long _uniqueId;
|
||||
WebViewJavascriptBridgeBase *_base;
|
||||
}
|
||||
|
||||
/* API
|
||||
*****/
|
||||
|
||||
+ (void)enableLogging { [WebViewJavascriptBridgeBase enableLogging]; }
|
||||
|
||||
+ (instancetype)bridgeForWebView:(WKWebView*)webView {
|
||||
WKWebViewJavascriptBridge* bridge = [[self alloc] init];
|
||||
[bridge _setupInstance:webView];
|
||||
[bridge reset];
|
||||
return bridge;
|
||||
}
|
||||
|
||||
- (void)send:(id)data {
|
||||
[self send:data responseCallback:nil];
|
||||
}
|
||||
|
||||
- (void)send:(id)data responseCallback:(WVJBResponseCallback)responseCallback {
|
||||
[_base sendData:data responseCallback:responseCallback handlerName:nil];
|
||||
}
|
||||
|
||||
- (void)callHandler:(NSString *)handlerName {
|
||||
[self callHandler:handlerName data:nil responseCallback:nil];
|
||||
}
|
||||
|
||||
- (void)callHandler:(NSString *)handlerName data:(id)data {
|
||||
[self callHandler:handlerName data:data responseCallback:nil];
|
||||
}
|
||||
|
||||
- (void)callHandler:(NSString *)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback {
|
||||
[_base sendData:data responseCallback:responseCallback handlerName:handlerName];
|
||||
}
|
||||
|
||||
- (void)registerHandler:(NSString *)handlerName handler:(WVJBHandler)handler {
|
||||
_base.messageHandlers[handlerName] = [handler copy];
|
||||
}
|
||||
|
||||
- (void)removeHandler:(NSString *)handlerName {
|
||||
[_base.messageHandlers removeObjectForKey:handlerName];
|
||||
}
|
||||
|
||||
- (void)reset {
|
||||
[_base reset];
|
||||
}
|
||||
|
||||
- (void)setWebViewDelegate:(id<WKNavigationDelegate>)webViewDelegate {
|
||||
_webViewDelegate = webViewDelegate;
|
||||
}
|
||||
|
||||
- (void)disableJavscriptAlertBoxSafetyTimeout {
|
||||
[_base disableJavscriptAlertBoxSafetyTimeout];
|
||||
}
|
||||
|
||||
/* Internals
|
||||
***********/
|
||||
|
||||
- (void)dealloc {
|
||||
_base = nil;
|
||||
_webView = nil;
|
||||
_webViewDelegate = nil;
|
||||
_webView.navigationDelegate = nil;
|
||||
}
|
||||
|
||||
|
||||
/* WKWebView Specific Internals
|
||||
******************************/
|
||||
|
||||
- (void) _setupInstance:(WKWebView*)webView {
|
||||
_webView = webView;
|
||||
_webView.navigationDelegate = self;
|
||||
_base = [[WebViewJavascriptBridgeBase alloc] init];
|
||||
_base.delegate = self;
|
||||
}
|
||||
|
||||
|
||||
- (void)WKFlushMessageQueue {
|
||||
[_webView evaluateJavaScript:[_base webViewJavascriptFetchQueyCommand] completionHandler:^(NSString* result, NSError* error) {
|
||||
if (error != nil) {
|
||||
NSLog(@"WebViewJavascriptBridge: WARNING: Error when trying to fetch data from WKWebView: %@", error);
|
||||
}
|
||||
[_base flushMessageQueue:result];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
|
||||
if (webView != _webView) { return; }
|
||||
|
||||
__strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate;
|
||||
if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFinishNavigation:)]) {
|
||||
[strongDelegate webView:webView didFinishNavigation:navigation];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler {
|
||||
if (webView != _webView) { return; }
|
||||
|
||||
__strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate;
|
||||
if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationResponse:decisionHandler:)]) {
|
||||
[strongDelegate webView:webView decidePolicyForNavigationResponse:navigationResponse decisionHandler:decisionHandler];
|
||||
}
|
||||
else {
|
||||
decisionHandler(WKNavigationResponsePolicyAllow);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *))completionHandler {
|
||||
if (webView != _webView) { return; }
|
||||
|
||||
__strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate;
|
||||
if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didReceiveAuthenticationChallenge:completionHandler:)]) {
|
||||
[strongDelegate webView:webView didReceiveAuthenticationChallenge:challenge completionHandler:completionHandler];
|
||||
} else {
|
||||
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
|
||||
if (webView != _webView) { return; }
|
||||
NSURL *url = navigationAction.request.URL;
|
||||
__strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate;
|
||||
|
||||
if ([_base isWebViewJavascriptBridgeURL:url]) {
|
||||
if ([_base isBridgeLoadedURL:url]) {
|
||||
[_base injectJavascriptFile];
|
||||
} else if ([_base isQueueMessageURL:url]) {
|
||||
[self WKFlushMessageQueue];
|
||||
} else {
|
||||
[_base logUnkownMessage:url];
|
||||
}
|
||||
decisionHandler(WKNavigationActionPolicyCancel);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:decisionHandler:)]) {
|
||||
[_webViewDelegate webView:webView decidePolicyForNavigationAction:navigationAction decisionHandler:decisionHandler];
|
||||
} else {
|
||||
decisionHandler(WKNavigationActionPolicyAllow);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation {
|
||||
if (webView != _webView) { return; }
|
||||
|
||||
__strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate;
|
||||
if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didStartProvisionalNavigation:)]) {
|
||||
[strongDelegate webView:webView didStartProvisionalNavigation:navigation];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error {
|
||||
if (webView != _webView) { return; }
|
||||
|
||||
__strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate;
|
||||
if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFailNavigation:withError:)]) {
|
||||
[strongDelegate webView:webView didFailNavigation:navigation withError:error];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error {
|
||||
if (webView != _webView) { return; }
|
||||
|
||||
__strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate;
|
||||
if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFailProvisionalNavigation:withError:)]) {
|
||||
[strongDelegate webView:webView didFailProvisionalNavigation:navigation withError:error];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString*) _evaluateJavascript:(NSString*)javascriptCommand {
|
||||
[_webView evaluateJavaScript:javascriptCommand completionHandler:nil];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#endif
|
43
WebViewJavascriptBridge/WebViewJavascriptBridge.h
Executable file
43
WebViewJavascriptBridge/WebViewJavascriptBridge.h
Executable file
@ -0,0 +1,43 @@
|
||||
//
|
||||
// WebViewJavascriptBridge.h
|
||||
// ExampleApp-iOS
|
||||
//
|
||||
// Created by Marcus Westin on 6/14/13.
|
||||
// Copyright (c) 2013 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WebViewJavascriptBridgeBase.h"
|
||||
|
||||
#if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_1)
|
||||
#define supportsWKWebView
|
||||
#endif
|
||||
|
||||
#if defined supportsWKWebView
|
||||
#import <WebKit/WebKit.h>
|
||||
#endif
|
||||
|
||||
#define WVJB_PLATFORM_OSX
|
||||
#define WVJB_WEBVIEW_TYPE WebView
|
||||
#define WVJB_WEBVIEW_DELEGATE_TYPE NSObject<WebViewJavascriptBridgeBaseDelegate>
|
||||
#define WVJB_WEBVIEW_DELEGATE_INTERFACE NSObject<WebViewJavascriptBridgeBaseDelegate, WebPolicyDelegate>
|
||||
|
||||
|
||||
@interface WebViewJavascriptBridge : WVJB_WEBVIEW_DELEGATE_INTERFACE
|
||||
|
||||
|
||||
+ (instancetype)bridgeForWebView:(id)webView;
|
||||
+ (instancetype)bridge:(id)webView;
|
||||
|
||||
+ (void)enableLogging;
|
||||
+ (void)setLogMaxLength:(int)length;
|
||||
|
||||
- (void)registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler;
|
||||
- (void)removeHandler:(NSString*)handlerName;
|
||||
- (void)callHandler:(NSString*)handlerName;
|
||||
- (void)callHandler:(NSString*)handlerName data:(id)data;
|
||||
- (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback;
|
||||
- (void)setWebViewDelegate:(id)webViewDelegate;
|
||||
- (void)disableJavscriptAlertBoxSafetyTimeout;
|
||||
|
||||
@end
|
142
WebViewJavascriptBridge/WebViewJavascriptBridge.m
Executable file
142
WebViewJavascriptBridge/WebViewJavascriptBridge.m
Executable file
@ -0,0 +1,142 @@
|
||||
//
|
||||
// WebViewJavascriptBridge.m
|
||||
// ExampleApp-iOS
|
||||
//
|
||||
// Created by Marcus Westin on 6/14/13.
|
||||
// Copyright (c) 2013 Marcus Westin. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WebViewJavascriptBridge.h"
|
||||
|
||||
#if defined(supportsWKWebView)
|
||||
#import "WKWebViewJavascriptBridge.h"
|
||||
#endif
|
||||
|
||||
#if __has_feature(objc_arc_weak)
|
||||
#define WVJB_WEAK __weak
|
||||
#else
|
||||
#define WVJB_WEAK __unsafe_unretained
|
||||
#endif
|
||||
|
||||
@implementation WebViewJavascriptBridge {
|
||||
WVJB_WEAK WVJB_WEBVIEW_TYPE* _webView;
|
||||
WVJB_WEAK id _webViewDelegate;
|
||||
long _uniqueId;
|
||||
WebViewJavascriptBridgeBase *_base;
|
||||
}
|
||||
|
||||
/* API
|
||||
*****/
|
||||
|
||||
+ (void)enableLogging {
|
||||
[WebViewJavascriptBridgeBase enableLogging];
|
||||
}
|
||||
+ (void)setLogMaxLength:(int)length {
|
||||
[WebViewJavascriptBridgeBase setLogMaxLength:length];
|
||||
}
|
||||
|
||||
+ (instancetype)bridgeForWebView:(id)webView {
|
||||
return [self bridge:webView];
|
||||
}
|
||||
+ (instancetype)bridge:(id)webView {
|
||||
#if defined supportsWKWebView
|
||||
if ([webView isKindOfClass:[WKWebView class]]) {
|
||||
return (WebViewJavascriptBridge*) [WKWebViewJavascriptBridge bridgeForWebView:webView];
|
||||
}
|
||||
#endif
|
||||
if ([webView isKindOfClass:[WVJB_WEBVIEW_TYPE class]]) {
|
||||
WebViewJavascriptBridge* bridge = [[self alloc] init];
|
||||
[bridge _platformSpecificSetup:webView];
|
||||
return bridge;
|
||||
}
|
||||
[NSException raise:@"BadWebViewType" format:@"Unknown web view type."];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)setWebViewDelegate:(WVJB_WEBVIEW_DELEGATE_TYPE*)webViewDelegate {
|
||||
_webViewDelegate = webViewDelegate;
|
||||
}
|
||||
|
||||
- (void)send:(id)data {
|
||||
[self send:data responseCallback:nil];
|
||||
}
|
||||
|
||||
- (void)send:(id)data responseCallback:(WVJBResponseCallback)responseCallback {
|
||||
[_base sendData:data responseCallback:responseCallback handlerName:nil];
|
||||
}
|
||||
|
||||
- (void)callHandler:(NSString *)handlerName {
|
||||
[self callHandler:handlerName data:nil responseCallback:nil];
|
||||
}
|
||||
|
||||
- (void)callHandler:(NSString *)handlerName data:(id)data {
|
||||
[self callHandler:handlerName data:data responseCallback:nil];
|
||||
}
|
||||
|
||||
- (void)callHandler:(NSString *)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback {
|
||||
[_base sendData:data responseCallback:responseCallback handlerName:handlerName];
|
||||
}
|
||||
|
||||
- (void)registerHandler:(NSString *)handlerName handler:(WVJBHandler)handler {
|
||||
_base.messageHandlers[handlerName] = [handler copy];
|
||||
}
|
||||
|
||||
- (void)removeHandler:(NSString *)handlerName {
|
||||
[_base.messageHandlers removeObjectForKey:handlerName];
|
||||
}
|
||||
|
||||
- (void)disableJavscriptAlertBoxSafetyTimeout {
|
||||
[_base disableJavscriptAlertBoxSafetyTimeout];
|
||||
}
|
||||
|
||||
|
||||
/* Platform agnostic internals
|
||||
*****************************/
|
||||
|
||||
- (void)dealloc {
|
||||
[self _platformSpecificDealloc];
|
||||
_base = nil;
|
||||
_webView = nil;
|
||||
_webViewDelegate = nil;
|
||||
}
|
||||
|
||||
- (NSString*) _evaluateJavascript:(NSString*)javascriptCommand {
|
||||
return [_webView stringByEvaluatingJavaScriptFromString:javascriptCommand];
|
||||
}
|
||||
|
||||
/* Platform specific internals: OSX
|
||||
**********************************/
|
||||
|
||||
- (void) _platformSpecificSetup:(WVJB_WEBVIEW_TYPE*)webView {
|
||||
_webView = webView;
|
||||
_webView.policyDelegate = self;
|
||||
_base = [[WebViewJavascriptBridgeBase alloc] init];
|
||||
_base.delegate = self;
|
||||
}
|
||||
|
||||
- (void) _platformSpecificDealloc {
|
||||
_webView.policyDelegate = nil;
|
||||
}
|
||||
|
||||
- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener {
|
||||
if (webView != _webView) { return; }
|
||||
|
||||
NSURL *url = [request URL];
|
||||
if ([_base isWebViewJavascriptBridgeURL:url]) {
|
||||
if ([_base isBridgeLoadedURL:url]) {
|
||||
[_base injectJavascriptFile];
|
||||
} else if ([_base isQueueMessageURL:url]) {
|
||||
NSString *messageQueueString = [self _evaluateJavascript:[_base webViewJavascriptFetchQueyCommand]];
|
||||
[_base flushMessageQueue:messageQueueString];
|
||||
} else {
|
||||
[_base logUnkownMessage:url];
|
||||
}
|
||||
[listener ignore];
|
||||
} else if (_webViewDelegate && [_webViewDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:request:frame:decisionListener:)]) {
|
||||
[_webViewDelegate webView:webView decidePolicyForNavigationAction:actionInformation request:request frame:frame decisionListener:listener];
|
||||
} else {
|
||||
[listener use];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
46
WebViewJavascriptBridge/WebViewJavascriptBridgeBase.h
Executable file
46
WebViewJavascriptBridge/WebViewJavascriptBridgeBase.h
Executable file
@ -0,0 +1,46 @@
|
||||
//
|
||||
// WebViewJavascriptBridgeBase.h
|
||||
//
|
||||
// Created by @LokiMeyburg on 10/15/14.
|
||||
// Copyright (c) 2014 @LokiMeyburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#define kOldProtocolScheme @"wvjbscheme"
|
||||
#define kNewProtocolScheme @"https"
|
||||
#define kQueueHasMessage @"__wvjb_queue_message__"
|
||||
#define kBridgeLoaded @"__bridge_loaded__"
|
||||
|
||||
typedef void (^WVJBResponseCallback)(id responseData);
|
||||
typedef void (^WVJBHandler)(id data, WVJBResponseCallback responseCallback);
|
||||
typedef NSDictionary WVJBMessage;
|
||||
|
||||
@protocol WebViewJavascriptBridgeBaseDelegate <NSObject>
|
||||
- (NSString*) _evaluateJavascript:(NSString*)javascriptCommand;
|
||||
@end
|
||||
|
||||
@interface WebViewJavascriptBridgeBase : NSObject
|
||||
|
||||
|
||||
@property (weak, nonatomic) id <WebViewJavascriptBridgeBaseDelegate> delegate;
|
||||
@property (strong, nonatomic) NSMutableArray* startupMessageQueue;
|
||||
@property (strong, nonatomic) NSMutableDictionary* responseCallbacks;
|
||||
@property (strong, nonatomic) NSMutableDictionary* messageHandlers;
|
||||
@property (strong, nonatomic) WVJBHandler messageHandler;
|
||||
|
||||
+ (void)enableLogging;
|
||||
+ (void)setLogMaxLength:(int)length;
|
||||
- (void)reset;
|
||||
- (void)sendData:(id)data responseCallback:(WVJBResponseCallback)responseCallback handlerName:(NSString*)handlerName;
|
||||
- (void)flushMessageQueue:(NSString *)messageQueueString;
|
||||
- (void)injectJavascriptFile;
|
||||
- (BOOL)isWebViewJavascriptBridgeURL:(NSURL*)url;
|
||||
- (BOOL)isQueueMessageURL:(NSURL*)urll;
|
||||
- (BOOL)isBridgeLoadedURL:(NSURL*)urll;
|
||||
- (void)logUnkownMessage:(NSURL*)url;
|
||||
- (NSString *)webViewJavascriptCheckCommand;
|
||||
- (NSString *)webViewJavascriptFetchQueyCommand;
|
||||
- (void)disableJavscriptAlertBoxSafetyTimeout;
|
||||
|
||||
@end
|
221
WebViewJavascriptBridge/WebViewJavascriptBridgeBase.m
Executable file
221
WebViewJavascriptBridge/WebViewJavascriptBridgeBase.m
Executable file
@ -0,0 +1,221 @@
|
||||
//
|
||||
// WebViewJavascriptBridgeBase.m
|
||||
//
|
||||
// Created by @LokiMeyburg on 10/15/14.
|
||||
// Copyright (c) 2014 @LokiMeyburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WebViewJavascriptBridgeBase.h"
|
||||
#import "WebViewJavascriptBridge_JS.h"
|
||||
|
||||
@implementation WebViewJavascriptBridgeBase {
|
||||
__weak id _webViewDelegate;
|
||||
long _uniqueId;
|
||||
}
|
||||
|
||||
static bool logging = false;
|
||||
static int logMaxLength = 500;
|
||||
|
||||
+ (void)enableLogging { logging = true; }
|
||||
+ (void)setLogMaxLength:(int)length { logMaxLength = length;}
|
||||
|
||||
- (id)init {
|
||||
if (self = [super init]) {
|
||||
self.messageHandlers = [NSMutableDictionary dictionary];
|
||||
self.startupMessageQueue = [NSMutableArray array];
|
||||
self.responseCallbacks = [NSMutableDictionary dictionary];
|
||||
_uniqueId = 0;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
self.startupMessageQueue = nil;
|
||||
self.responseCallbacks = nil;
|
||||
self.messageHandlers = nil;
|
||||
}
|
||||
|
||||
- (void)reset {
|
||||
self.startupMessageQueue = [NSMutableArray array];
|
||||
self.responseCallbacks = [NSMutableDictionary dictionary];
|
||||
_uniqueId = 0;
|
||||
}
|
||||
|
||||
- (void)sendData:(id)data responseCallback:(WVJBResponseCallback)responseCallback handlerName:(NSString*)handlerName {
|
||||
NSMutableDictionary* message = [NSMutableDictionary dictionary];
|
||||
|
||||
if (data) {
|
||||
message[@"data"] = data;
|
||||
}
|
||||
|
||||
if (responseCallback) {
|
||||
NSString* callbackId = [NSString stringWithFormat:@"objc_cb_%ld", ++_uniqueId];
|
||||
self.responseCallbacks[callbackId] = [responseCallback copy];
|
||||
message[@"callbackId"] = callbackId;
|
||||
}
|
||||
|
||||
if (handlerName) {
|
||||
message[@"handlerName"] = handlerName;
|
||||
}
|
||||
[self _queueMessage:message];
|
||||
}
|
||||
|
||||
- (void)flushMessageQueue:(NSString *)messageQueueString{
|
||||
if (messageQueueString == nil || messageQueueString.length == 0) {
|
||||
NSLog(@"WebViewJavascriptBridge: WARNING: ObjC got nil while fetching the message queue JSON from webview. This can happen if the WebViewJavascriptBridge JS is not currently present in the webview, e.g if the webview just loaded a new page.");
|
||||
return;
|
||||
}
|
||||
|
||||
id messages = [self _deserializeMessageJSON:messageQueueString];
|
||||
for (WVJBMessage* message in messages) {
|
||||
if (![message isKindOfClass:[WVJBMessage class]]) {
|
||||
NSLog(@"WebViewJavascriptBridge: WARNING: Invalid %@ received: %@", [message class], message);
|
||||
continue;
|
||||
}
|
||||
[self _log:@"RCVD" json:message];
|
||||
|
||||
NSString* responseId = message[@"responseId"];
|
||||
if (responseId) {
|
||||
WVJBResponseCallback responseCallback = _responseCallbacks[responseId];
|
||||
responseCallback(message[@"responseData"]);
|
||||
[self.responseCallbacks removeObjectForKey:responseId];
|
||||
} else {
|
||||
WVJBResponseCallback responseCallback = NULL;
|
||||
NSString* callbackId = message[@"callbackId"];
|
||||
if (callbackId) {
|
||||
responseCallback = ^(id responseData) {
|
||||
if (responseData == nil) {
|
||||
responseData = [NSNull null];
|
||||
}
|
||||
|
||||
WVJBMessage* msg = @{ @"responseId":callbackId, @"responseData":responseData };
|
||||
[self _queueMessage:msg];
|
||||
};
|
||||
} else {
|
||||
responseCallback = ^(id ignoreResponseData) {
|
||||
// Do nothing
|
||||
};
|
||||
}
|
||||
|
||||
WVJBHandler handler = self.messageHandlers[message[@"handlerName"]];
|
||||
|
||||
if (!handler) {
|
||||
NSLog(@"WVJBNoHandlerException, No handler for message from JS: %@", message);
|
||||
continue;
|
||||
}
|
||||
|
||||
handler(message[@"data"], responseCallback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)injectJavascriptFile {
|
||||
NSString *js = WebViewJavascriptBridge_js();
|
||||
[self _evaluateJavascript:js];
|
||||
if (self.startupMessageQueue) {
|
||||
NSArray* queue = self.startupMessageQueue;
|
||||
self.startupMessageQueue = nil;
|
||||
for (id queuedMessage in queue) {
|
||||
[self _dispatchMessage:queuedMessage];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)isWebViewJavascriptBridgeURL:(NSURL*)url {
|
||||
if (![self isSchemeMatch:url]) {
|
||||
return NO;
|
||||
}
|
||||
return [self isBridgeLoadedURL:url] || [self isQueueMessageURL:url];
|
||||
}
|
||||
|
||||
- (BOOL)isSchemeMatch:(NSURL*)url {
|
||||
NSString* scheme = url.scheme.lowercaseString;
|
||||
return [scheme isEqualToString:kNewProtocolScheme] || [scheme isEqualToString:kOldProtocolScheme];
|
||||
}
|
||||
|
||||
- (BOOL)isQueueMessageURL:(NSURL*)url {
|
||||
NSString* host = url.host.lowercaseString;
|
||||
return [self isSchemeMatch:url] && [host isEqualToString:kQueueHasMessage];
|
||||
}
|
||||
|
||||
- (BOOL)isBridgeLoadedURL:(NSURL*)url {
|
||||
NSString* host = url.host.lowercaseString;
|
||||
return [self isSchemeMatch:url] && [host isEqualToString:kBridgeLoaded];
|
||||
}
|
||||
|
||||
- (void)logUnkownMessage:(NSURL*)url {
|
||||
NSLog(@"WebViewJavascriptBridge: WARNING: Received unknown WebViewJavascriptBridge command %@", [url absoluteString]);
|
||||
}
|
||||
|
||||
- (NSString *)webViewJavascriptCheckCommand {
|
||||
return @"typeof WebViewJavascriptBridge == \'object\';";
|
||||
}
|
||||
|
||||
- (NSString *)webViewJavascriptFetchQueyCommand {
|
||||
return @"WebViewJavascriptBridge._fetchQueue();";
|
||||
}
|
||||
|
||||
- (void)disableJavscriptAlertBoxSafetyTimeout {
|
||||
[self sendData:nil responseCallback:nil handlerName:@"_disableJavascriptAlertBoxSafetyTimeout"];
|
||||
}
|
||||
|
||||
// Private
|
||||
// -------------------------------------------
|
||||
|
||||
- (void) _evaluateJavascript:(NSString *)javascriptCommand {
|
||||
[self.delegate _evaluateJavascript:javascriptCommand];
|
||||
}
|
||||
|
||||
- (void)_queueMessage:(WVJBMessage*)message {
|
||||
if (self.startupMessageQueue) {
|
||||
[self.startupMessageQueue addObject:message];
|
||||
} else {
|
||||
[self _dispatchMessage:message];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_dispatchMessage:(WVJBMessage*)message {
|
||||
NSString *messageJSON = [self _serializeMessage:message pretty:NO];
|
||||
[self _log:@"SEND" json:messageJSON];
|
||||
messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\\" withString:@"\\\\"];
|
||||
messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
|
||||
messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\'" withString:@"\\\'"];
|
||||
messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"];
|
||||
messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\r" withString:@"\\r"];
|
||||
messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\f" withString:@"\\f"];
|
||||
messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\u2028" withString:@"\\u2028"];
|
||||
messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\u2029" withString:@"\\u2029"];
|
||||
|
||||
NSString* javascriptCommand = [NSString stringWithFormat:@"WebViewJavascriptBridge._handleMessageFromObjC('%@');", messageJSON];
|
||||
if ([[NSThread currentThread] isMainThread]) {
|
||||
[self _evaluateJavascript:javascriptCommand];
|
||||
|
||||
} else {
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[self _evaluateJavascript:javascriptCommand];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)_serializeMessage:(id)message pretty:(BOOL)pretty{
|
||||
return [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:message options:(NSJSONWritingOptions)(pretty ? NSJSONWritingPrettyPrinted : 0) error:nil] encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
|
||||
- (NSArray*)_deserializeMessageJSON:(NSString *)messageJSON {
|
||||
return [NSJSONSerialization JSONObjectWithData:[messageJSON dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:nil];
|
||||
}
|
||||
|
||||
- (void)_log:(NSString *)action json:(id)json {
|
||||
if (!logging) { return; }
|
||||
if (![json isKindOfClass:[NSString class]]) {
|
||||
json = [self _serializeMessage:json pretty:YES];
|
||||
}
|
||||
if ([json length] > logMaxLength) {
|
||||
NSLog(@"WVJB %@: %@ [...]", action, [json substringToIndex:logMaxLength]);
|
||||
} else {
|
||||
NSLog(@"WVJB %@: %@", action, json);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
3
WebViewJavascriptBridge/WebViewJavascriptBridge_JS.h
Normal file
3
WebViewJavascriptBridge/WebViewJavascriptBridge_JS.h
Normal file
@ -0,0 +1,3 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NSString * WebViewJavascriptBridge_js(void);
|
139
WebViewJavascriptBridge/WebViewJavascriptBridge_JS.m
Normal file
139
WebViewJavascriptBridge/WebViewJavascriptBridge_JS.m
Normal file
@ -0,0 +1,139 @@
|
||||
// This file contains the source for the Javascript side of the
|
||||
// WebViewJavascriptBridge. It is plaintext, but converted to an NSString
|
||||
// via some preprocessor tricks.
|
||||
//
|
||||
// Previous implementations of WebViewJavascriptBridge loaded the javascript source
|
||||
// from a resource. This worked fine for app developers, but library developers who
|
||||
// included the bridge into their library, awkwardly had to ask consumers of their
|
||||
// library to include the resource, violating their encapsulation. By including the
|
||||
// Javascript as a string resource, the encapsulation of the library is maintained.
|
||||
|
||||
#import "WebViewJavascriptBridge_JS.h"
|
||||
|
||||
NSString * WebViewJavascriptBridge_js() {
|
||||
#define __wvjb_js_func__(x) #x
|
||||
|
||||
// BEGIN preprocessorJSCode
|
||||
static NSString * preprocessorJSCode = @__wvjb_js_func__(
|
||||
;(function() {
|
||||
if (window.WebViewJavascriptBridge) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!window.onerror) {
|
||||
window.onerror = function(msg, url, line) {
|
||||
console.log("WebViewJavascriptBridge: ERROR:" + msg + "@" + url + ":" + line);
|
||||
}
|
||||
}
|
||||
window.WebViewJavascriptBridge = {
|
||||
registerHandler: registerHandler,
|
||||
callHandler: callHandler,
|
||||
disableJavscriptAlertBoxSafetyTimeout: disableJavscriptAlertBoxSafetyTimeout,
|
||||
_fetchQueue: _fetchQueue,
|
||||
_handleMessageFromObjC: _handleMessageFromObjC
|
||||
};
|
||||
|
||||
var messagingIframe;
|
||||
var sendMessageQueue = [];
|
||||
var messageHandlers = {};
|
||||
|
||||
var CUSTOM_PROTOCOL_SCHEME = 'https';
|
||||
var QUEUE_HAS_MESSAGE = '__wvjb_queue_message__';
|
||||
|
||||
var responseCallbacks = {};
|
||||
var uniqueId = 1;
|
||||
var dispatchMessagesWithTimeoutSafety = true;
|
||||
|
||||
function registerHandler(handlerName, handler) {
|
||||
messageHandlers[handlerName] = handler;
|
||||
}
|
||||
|
||||
function callHandler(handlerName, data, responseCallback) {
|
||||
if (arguments.length == 2 && typeof data == 'function') {
|
||||
responseCallback = data;
|
||||
data = null;
|
||||
}
|
||||
_doSend({ handlerName:handlerName, data:data }, responseCallback);
|
||||
}
|
||||
function disableJavscriptAlertBoxSafetyTimeout() {
|
||||
dispatchMessagesWithTimeoutSafety = false;
|
||||
}
|
||||
|
||||
function _doSend(message, responseCallback) {
|
||||
if (responseCallback) {
|
||||
var callbackId = 'cb_'+(uniqueId++)+'_'+new Date().getTime();
|
||||
responseCallbacks[callbackId] = responseCallback;
|
||||
message['callbackId'] = callbackId;
|
||||
}
|
||||
sendMessageQueue.push(message);
|
||||
messagingIframe.src = CUSTOM_PROTOCOL_SCHEME + '://' + QUEUE_HAS_MESSAGE;
|
||||
}
|
||||
|
||||
function _fetchQueue() {
|
||||
var messageQueueString = JSON.stringify(sendMessageQueue);
|
||||
sendMessageQueue = [];
|
||||
return messageQueueString;
|
||||
}
|
||||
|
||||
function _dispatchMessageFromObjC(messageJSON) {
|
||||
if (dispatchMessagesWithTimeoutSafety) {
|
||||
setTimeout(_doDispatchMessageFromObjC);
|
||||
} else {
|
||||
_doDispatchMessageFromObjC();
|
||||
}
|
||||
|
||||
function _doDispatchMessageFromObjC() {
|
||||
var message = JSON.parse(messageJSON);
|
||||
var messageHandler;
|
||||
var responseCallback;
|
||||
|
||||
if (message.responseId) {
|
||||
responseCallback = responseCallbacks[message.responseId];
|
||||
if (!responseCallback) {
|
||||
return;
|
||||
}
|
||||
responseCallback(message.responseData);
|
||||
delete responseCallbacks[message.responseId];
|
||||
} else {
|
||||
if (message.callbackId) {
|
||||
var callbackResponseId = message.callbackId;
|
||||
responseCallback = function(responseData) {
|
||||
_doSend({ handlerName:message.handlerName, responseId:callbackResponseId, responseData:responseData });
|
||||
};
|
||||
}
|
||||
|
||||
var handler = messageHandlers[message.handlerName];
|
||||
if (!handler) {
|
||||
console.log("WebViewJavascriptBridge: WARNING: no handler for message from ObjC:", message);
|
||||
} else {
|
||||
handler(message.data, responseCallback);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _handleMessageFromObjC(messageJSON) {
|
||||
_dispatchMessageFromObjC(messageJSON);
|
||||
}
|
||||
|
||||
messagingIframe = document.createElement('iframe');
|
||||
messagingIframe.style.display = 'none';
|
||||
messagingIframe.src = CUSTOM_PROTOCOL_SCHEME + '://' + QUEUE_HAS_MESSAGE;
|
||||
document.documentElement.appendChild(messagingIframe);
|
||||
|
||||
registerHandler("_disableJavascriptAlertBoxSafetyTimeout", disableJavscriptAlertBoxSafetyTimeout);
|
||||
|
||||
setTimeout(_callWVJBCallbacks, 0);
|
||||
function _callWVJBCallbacks() {
|
||||
var callbacks = window.WVJBCallbacks;
|
||||
delete window.WVJBCallbacks;
|
||||
for (var i=0; i<callbacks.length; i++) {
|
||||
callbacks[i](WebViewJavascriptBridge);
|
||||
}
|
||||
}
|
||||
})();
|
||||
); // END preprocessorJSCode
|
||||
|
||||
#undef __wvjb_js_func__
|
||||
return preprocessorJSCode;
|
||||
};
|
10
circle.yml
Normal file
10
circle.yml
Normal file
@ -0,0 +1,10 @@
|
||||
machine:
|
||||
xcode:
|
||||
version: 9.0
|
||||
# dependencies:
|
||||
# override:
|
||||
# - brew install kylef/formulae/swiftenv
|
||||
# - swiftenv install 3.0
|
||||
test:
|
||||
override:
|
||||
- make test-circle-ci
|
Loading…
x
Reference in New Issue
Block a user