diff --git a/Changelog b/Changelog deleted file mode 100644 index af90a6d3..00000000 --- a/Changelog +++ /dev/null @@ -1,106 +0,0 @@ -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 diff --git a/Example Apps/ExampleApp-OSX/AppDelegate.h b/Example Apps/ExampleApp-OSX/AppDelegate.h deleted file mode 100644 index 6d91daf4..00000000 --- a/Example Apps/ExampleApp-OSX/AppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// AppDelegate.h -// ExampleApp-OSX -// -// Created by Marcus Westin on 6/8/13. -// Copyright (c) 2013 Marcus Westin. All rights reserved. -// - -#import - -@interface AppDelegate : NSObject - -@property (assign) IBOutlet NSWindow *window; - -@end diff --git a/Example Apps/ExampleApp-OSX/AppDelegate.m b/Example Apps/ExampleApp-OSX/AppDelegate.m deleted file mode 100644 index 5677342a..00000000 --- a/Example Apps/ExampleApp-OSX/AppDelegate.m +++ /dev/null @@ -1,131 +0,0 @@ -// -// AppDelegate.m -// ExampleApp-OSX -// -// Created by Marcus Westin on 6/8/13. -// Copyright (c) 2013 Marcus Westin. All rights reserved. -// - -#import "AppDelegate.h" -#import -#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 diff --git a/Example Apps/ExampleApp-OSX/ExampleApp-OSX-Info.plist b/Example Apps/ExampleApp-OSX/ExampleApp-OSX-Info.plist deleted file mode 100644 index b9f1feaa..00000000 --- a/Example Apps/ExampleApp-OSX/ExampleApp-OSX-Info.plist +++ /dev/null @@ -1,34 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - NSHumanReadableCopyright - Copyright © 2013 Marcus Westin. All rights reserved. - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/Example Apps/ExampleApp-OSX/ExampleApp-OSX-Prefix.pch b/Example Apps/ExampleApp-OSX/ExampleApp-OSX-Prefix.pch deleted file mode 100644 index 32daebd5..00000000 --- a/Example Apps/ExampleApp-OSX/ExampleApp-OSX-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'ExampleApp-OSX' target in the 'ExampleApp-OSX' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/Example Apps/ExampleApp-OSX/MainMenu.xib b/Example Apps/ExampleApp-OSX/MainMenu.xib deleted file mode 100644 index 7dd49232..00000000 --- a/Example Apps/ExampleApp-OSX/MainMenu.xib +++ /dev/null @@ -1,3244 +0,0 @@ - - - - 1070 - 11E53 - 2844 - 1138.47 - 569.00 - - 2844 - 1810 - - - NSCustomObject - NSMenu - NSMenuItem - NSView - NSWindowTemplate - WebView - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.WebKitIBPlugin - - - PluginDependencyRecalculationVersion - - - - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - - - ExampleApp-OSX - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - ExampleApp-OSX - - - - About ExampleApp-OSX - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide ExampleApp-OSX - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit ExampleApp-OSX - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 1048576 - 2147483647 - - - submenuAction: - - File - - - - New - n - 1048576 - 2147483647 - - - - - - Open… - o - 1048576 - 2147483647 - - - - - - Open Recent - - 1048576 - 2147483647 - - - submenuAction: - - Open Recent - - - - Clear Menu - - 1048576 - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save… - s - 1048576 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 1048576 - 2147483647 - - - submenuAction: - - Edit - - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1179648 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Paste and Match Style - V - 1572864 - 2147483647 - - - - - - Delete - - 1048576 - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Find - - 1048576 - 2147483647 - - - submenuAction: - - Find - - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find and Replace… - f - 1572864 - 2147483647 - - - 12 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1179648 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 1048576 - 2147483647 - - - submenuAction: - - Spelling and Grammar - - - - Show Spelling and Grammar - : - 1048576 - 2147483647 - - - - - - Check Document Now - ; - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Check Spelling While Typing - - 1048576 - 2147483647 - - - - - - Check Grammar With Spelling - - 1048576 - 2147483647 - - - - - - Correct Spelling Automatically - - 2147483647 - - - - - - - - - Substitutions - - 1048576 - 2147483647 - - - submenuAction: - - Substitutions - - - - Show Substitutions - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Smart Copy/Paste - f - 1048576 - 2147483647 - - - 1 - - - - Smart Quotes - g - 1048576 - 2147483647 - - - 2 - - - - Smart Dashes - - 2147483647 - - - - - - Smart Links - G - 1179648 - 2147483647 - - - 3 - - - - Text Replacement - - 2147483647 - - - - - - - - - Transformations - - 2147483647 - - - submenuAction: - - Transformations - - - - Make Upper Case - - 2147483647 - - - - - - Make Lower Case - - 2147483647 - - - - - - Capitalize - - 2147483647 - - - - - - - - - Speech - - 1048576 - 2147483647 - - - submenuAction: - - Speech - - - - Start Speaking - - 1048576 - 2147483647 - - - - - - Stop Speaking - - 1048576 - 2147483647 - - - - - - - - - - - - Format - - 2147483647 - - - submenuAction: - - Format - - - - Font - - 2147483647 - - - submenuAction: - - Font - - - - Show Fonts - t - 1048576 - 2147483647 - - - - - - Bold - b - 1048576 - 2147483647 - - - 2 - - - - Italic - i - 1048576 - 2147483647 - - - 1 - - - - Underline - u - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bigger - + - 1048576 - 2147483647 - - - 3 - - - - Smaller - - - 1048576 - 2147483647 - - - 4 - - - - YES - YES - - - 2147483647 - - - - - - Kern - - 2147483647 - - - submenuAction: - - Kern - - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Tighten - - 2147483647 - - - - - - Loosen - - 2147483647 - - - - - - - - - Ligatures - - 2147483647 - - - submenuAction: - - Ligatures - - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Use All - - 2147483647 - - - - - - - - - Baseline - - 2147483647 - - - submenuAction: - - Baseline - - - - Use Default - - 2147483647 - - - - - - Superscript - - 2147483647 - - - - - - Subscript - - 2147483647 - - - - - - Raise - - 2147483647 - - - - - - Lower - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Colors - C - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Copy Style - c - 1572864 - 2147483647 - - - - - - Paste Style - v - 1572864 - 2147483647 - - - - - _NSFontMenu - - - - - Text - - 2147483647 - - - submenuAction: - - Text - - - - Align Left - { - 1048576 - 2147483647 - - - - - - Center - | - 1048576 - 2147483647 - - - - - - Justify - - 2147483647 - - - - - - Align Right - } - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Writing Direction - - 2147483647 - - - submenuAction: - - Writing Direction - - - - YES - Paragraph - - 2147483647 - - - - - - CURlZmF1bHQ - - 2147483647 - - - - - - CUxlZnQgdG8gUmlnaHQ - - 2147483647 - - - - - - CVJpZ2h0IHRvIExlZnQ - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - YES - Selection - - 2147483647 - - - - - - CURlZmF1bHQ - - 2147483647 - - - - - - CUxlZnQgdG8gUmlnaHQ - - 2147483647 - - - - - - CVJpZ2h0IHRvIExlZnQ - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Ruler - - 2147483647 - - - - - - Copy Ruler - c - 1310720 - 2147483647 - - - - - - Paste Ruler - v - 1310720 - 2147483647 - - - - - - - - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Customize Toolbar… - - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - - - ExampleApp-OSX Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - 15 - 2 - {{335, 390}, {480, 360}} - 1954021376 - ExampleApp-OSX - NSWindow - - - - - 256 - {480, 360} - - - - - {{0, 0}, {1280, 778}} - {10000000000000, 10000000000000} - YES - - - AppDelegate - - - NSFontManager - - - - 256 - - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple URL pasteboard type - Apple Web Archive pasteboard type - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - WebURLsWithTitlesPboardType - public.png - public.url - public.url-name - - {254, 200} - - - _NS:9 - - - - - - - - - - - YES - YES - - - - - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 495 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - performClose: - - - - 193 - - - - toggleContinuousSpellChecking: - - - - 222 - - - - undo: - - - - 223 - - - - copy: - - - - 224 - - - - checkSpelling: - - - - 225 - - - - paste: - - - - 226 - - - - stopSpeaking: - - - - 227 - - - - cut: - - - - 228 - - - - showGuessPanel: - - - - 230 - - - - redo: - - - - 231 - - - - selectAll: - - - - 232 - - - - startSpeaking: - - - - 233 - - - - delete: - - - - 235 - - - - performZoom: - - - - 240 - - - - performFindPanelAction: - - - - 241 - - - - centerSelectionInVisibleArea: - - - - 245 - - - - toggleGrammarChecking: - - - - 347 - - - - toggleSmartInsertDelete: - - - - 355 - - - - toggleAutomaticQuoteSubstitution: - - - - 356 - - - - toggleAutomaticLinkDetection: - - - - 357 - - - - saveDocument: - - - - 362 - - - - revertDocumentToSaved: - - - - 364 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - newDocument: - - - - 373 - - - - openDocument: - - - - 374 - - - - raiseBaseline: - - - - 426 - - - - lowerBaseline: - - - - 427 - - - - copyFont: - - - - 428 - - - - subscript: - - - - 429 - - - - superscript: - - - - 430 - - - - tightenKerning: - - - - 431 - - - - underline: - - - - 432 - - - - orderFrontColorPanel: - - - - 433 - - - - useAllLigatures: - - - - 434 - - - - loosenKerning: - - - - 435 - - - - pasteFont: - - - - 436 - - - - unscript: - - - - 437 - - - - useStandardKerning: - - - - 438 - - - - useStandardLigatures: - - - - 439 - - - - turnOffLigatures: - - - - 440 - - - - turnOffKerning: - - - - 441 - - - - toggleAutomaticSpellingCorrection: - - - - 456 - - - - orderFrontSubstitutionsPanel: - - - - 458 - - - - toggleAutomaticDashSubstitution: - - - - 461 - - - - toggleAutomaticTextReplacement: - - - - 463 - - - - uppercaseWord: - - - - 464 - - - - capitalizeWord: - - - - 467 - - - - lowercaseWord: - - - - 468 - - - - pasteAsPlainText: - - - - 486 - - - - performFindPanelAction: - - - - 487 - - - - performFindPanelAction: - - - - 488 - - - - performFindPanelAction: - - - - 489 - - - - showHelp: - - - - 493 - - - - alignCenter: - - - - 518 - - - - pasteRuler: - - - - 519 - - - - toggleRuler: - - - - 520 - - - - alignRight: - - - - 521 - - - - copyRuler: - - - - 522 - - - - alignJustified: - - - - 523 - - - - alignLeft: - - - - 524 - - - - makeBaseWritingDirectionNatural: - - - - 525 - - - - makeBaseWritingDirectionLeftToRight: - - - - 526 - - - - makeBaseWritingDirectionRightToLeft: - - - - 527 - - - - makeTextWritingDirectionNatural: - - - - 528 - - - - makeTextWritingDirectionLeftToRight: - - - - 529 - - - - makeTextWritingDirectionRightToLeft: - - - - 530 - - - - performFindPanelAction: - - - - 535 - - - - addFontTrait: - - - - 421 - - - - addFontTrait: - - - - 422 - - - - modifyFont: - - - - 423 - - - - orderFrontFontPanel: - - - - 424 - - - - modifyFont: - - - - 425 - - - - window - - - - 532 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - - - - - - - - - - - - 19 - - - - - - - - 56 - - - - - - - - 217 - - - - - - - - 83 - - - - - - - - 81 - - - - - - - - - - - - - - - - - 75 - - - - - 78 - - - - - 72 - - - - - 82 - - - - - 124 - - - - - - - - 77 - - - - - 73 - - - - - 79 - - - - - 112 - - - - - 74 - - - - - 125 - - - - - - - - 126 - - - - - 205 - - - - - - - - - - - - - - - - - - - - - - 202 - - - - - 198 - - - - - 207 - - - - - 214 - - - - - 199 - - - - - 203 - - - - - 197 - - - - - 206 - - - - - 215 - - - - - 218 - - - - - - - - 216 - - - - - - - - 200 - - - - - - - - - - - - - 219 - - - - - 201 - - - - - 204 - - - - - 220 - - - - - - - - - - - - - 213 - - - - - 210 - - - - - 221 - - - - - 208 - - - - - 209 - - - - - 57 - - - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - - - - - - 296 - - - - - - - - - 297 - - - - - 298 - - - - - 211 - - - - - - - - 212 - - - - - - - - - 195 - - - - - 196 - - - - - 346 - - - - - 348 - - - - - - - - 349 - - - - - - - - - - - - - - 350 - - - - - 351 - - - - - 354 - - - - - 375 - - - - - - - - 376 - - - - - - - - - 377 - - - - - - - - 388 - - - - - - - - - - - - - - - - - - - - - - - 389 - - - - - 390 - - - - - 391 - - - - - 392 - - - - - 393 - - - - - 394 - - - - - 395 - - - - - 396 - - - - - 397 - - - - - - - - 398 - - - - - - - - 399 - - - - - - - - 400 - - - - - 401 - - - - - 402 - - - - - 403 - - - - - 404 - - - - - 405 - - - - - - - - - - - - 406 - - - - - 407 - - - - - 408 - - - - - 409 - - - - - 410 - - - - - 411 - - - - - - - - - - 412 - - - - - 413 - - - - - 414 - - - - - 415 - - - - - - - - - - - 416 - - - - - 417 - - - - - 418 - - - - - 419 - - - - - 420 - - - - - 450 - - - - - - - - 451 - - - - - - - - - - 452 - - - - - 453 - - - - - 454 - - - - - 457 - - - - - 459 - - - - - 460 - - - - - 462 - - - - - 465 - - - - - 466 - - - - - 485 - - - - - 490 - - - - - - - - 491 - - - - - - - - 492 - - - - - 494 - - - - - 496 - - - - - - - - 497 - - - - - - - - - - - - - - - - - 498 - - - - - 499 - - - - - 500 - - - - - 501 - - - - - 502 - - - - - 503 - - - - - - - - 504 - - - - - 505 - - - - - 506 - - - - - 507 - - - - - 508 - - - - - - - - - - - - - - - - 509 - - - - - 510 - - - - - 511 - - - - - 512 - - - - - 513 - - - - - 514 - - - - - 515 - - - - - 516 - - - - - 517 - - - - - 534 - - - - - 544 - - - - - 371 - - - - - - - - 372 - - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{380, 496}, {480, 360}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.WebKitIBPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 559 - - - - - AppDelegate - NSObject - - window - NSWindow - - - window - - window - NSWindow - - - - IBProjectSource - ./Classes/AppDelegate.h - - - - - 0 - IBCocoaFramework - YES - 3 - - {11, 11} - {10, 3} - - YES - - diff --git a/Example Apps/ExampleApp-OSX/en.lproj/Credits.rtf b/Example Apps/ExampleApp-OSX/en.lproj/Credits.rtf deleted file mode 100644 index 46576ef2..00000000 --- a/Example Apps/ExampleApp-OSX/en.lproj/Credits.rtf +++ /dev/null @@ -1,29 +0,0 @@ -{\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\ -} diff --git a/Example Apps/ExampleApp-OSX/en.lproj/InfoPlist.strings b/Example Apps/ExampleApp-OSX/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff..00000000 --- a/Example Apps/ExampleApp-OSX/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/Example Apps/ExampleApp-OSX/main.m b/Example Apps/ExampleApp-OSX/main.m deleted file mode 100644 index 0999e46a..00000000 --- a/Example Apps/ExampleApp-OSX/main.m +++ /dev/null @@ -1,14 +0,0 @@ -// -// main.m -// ExampleApp-OSX -// -// Created by Marcus Westin on 6/8/13. -// Copyright (c) 2013 Marcus Westin. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) -{ - return NSApplicationMain(argc, (const char **)argv); -} diff --git a/Example Apps/ExampleApp-iOS/Default-568h@2x.png b/Example Apps/ExampleApp-iOS/Default-568h@2x.png deleted file mode 100644 index 0891b7aa..00000000 Binary files a/Example Apps/ExampleApp-iOS/Default-568h@2x.png and /dev/null differ diff --git a/Example Apps/ExampleApp-iOS/ExampleApp-iOS-Info.plist b/Example Apps/ExampleApp-iOS/ExampleApp-iOS-Info.plist deleted file mode 100644 index 3eb70251..00000000 --- a/Example Apps/ExampleApp-iOS/ExampleApp-iOS-Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - - diff --git a/Example Apps/ExampleApp-iOS/ExampleApp-iOS-Prefix.pch b/Example Apps/ExampleApp-iOS/ExampleApp-iOS-Prefix.pch deleted file mode 100644 index 29f2d2ac..00000000 --- a/Example Apps/ExampleApp-iOS/ExampleApp-iOS-Prefix.pch +++ /dev/null @@ -1,14 +0,0 @@ -// -// Prefix header for all source files of the 'ExampleApp' target in the 'ExampleApp' project -// - -#import - -#ifndef __IPHONE_3_0 -#warning "This project uses features only available in iOS SDK 3.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/Example Apps/ExampleApp-iOS/ExampleAppDelegate.h b/Example Apps/ExampleApp-iOS/ExampleAppDelegate.h deleted file mode 100644 index f59015d8..00000000 --- a/Example Apps/ExampleApp-iOS/ExampleAppDelegate.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface ExampleAppDelegate : UIResponder -@property (nonatomic) UIWindow *window; -@end diff --git a/Example Apps/ExampleApp-iOS/ExampleAppDelegate.m b/Example Apps/ExampleApp-iOS/ExampleAppDelegate.m deleted file mode 100644 index ff9f5bef..00000000 --- a/Example Apps/ExampleApp-iOS/ExampleAppDelegate.m +++ /dev/null @@ -1,30 +0,0 @@ -#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 diff --git a/Example Apps/ExampleApp-iOS/ExampleUIWebViewController.h b/Example Apps/ExampleApp-iOS/ExampleUIWebViewController.h deleted file mode 100644 index 71364e80..00000000 --- a/Example Apps/ExampleApp-iOS/ExampleUIWebViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// ExampleUIWebViewController.h -// ExampleApp-iOS -// -// Created by Marcus Westin on 1/13/14. -// Copyright (c) 2014 Marcus Westin. All rights reserved. -// - -#import - -@interface ExampleUIWebViewController : UINavigationController - -@end \ No newline at end of file diff --git a/Example Apps/ExampleApp-iOS/ExampleUIWebViewController.m b/Example Apps/ExampleApp-iOS/ExampleUIWebViewController.m deleted file mode 100644 index f988a014..00000000 --- a/Example Apps/ExampleApp-iOS/ExampleUIWebViewController.m +++ /dev/null @@ -1,90 +0,0 @@ -// -// 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 diff --git a/Example Apps/ExampleApp-iOS/ExampleWKWebViewController.h b/Example Apps/ExampleApp-iOS/ExampleWKWebViewController.h deleted file mode 100644 index 7dd92b8e..00000000 --- a/Example Apps/ExampleApp-iOS/ExampleWKWebViewController.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// ExampleWKWebViewController.h -// ExampleApp-iOS -// -// Created by Marcus Westin on 1/13/14. -// Copyright (c) 2014 Marcus Westin. All rights reserved. -// - -#import -#import - -@interface ExampleWKWebViewController : UINavigationController - -@end \ No newline at end of file diff --git a/Example Apps/ExampleApp-iOS/ExampleWKWebViewController.m b/Example Apps/ExampleApp-iOS/ExampleWKWebViewController.m deleted file mode 100644 index f9d4ac79..00000000 --- a/Example Apps/ExampleApp-iOS/ExampleWKWebViewController.m +++ /dev/null @@ -1,80 +0,0 @@ -// -// 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 diff --git a/Example Apps/ExampleApp-iOS/en.lproj/InfoPlist.strings b/Example Apps/ExampleApp-iOS/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff..00000000 --- a/Example Apps/ExampleApp-iOS/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/Example Apps/ExampleApp-iOS/main.m b/Example Apps/ExampleApp-iOS/main.m deleted file mode 100644 index 003d3a8f..00000000 --- a/Example Apps/ExampleApp-iOS/main.m +++ /dev/null @@ -1,26 +0,0 @@ -#import -#import -#import -#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])); - } -} \ No newline at end of file diff --git a/Example Apps/ExampleApp.html b/Example Apps/ExampleApp.html deleted file mode 100644 index 06e7dc8a..00000000 --- a/Example Apps/ExampleApp.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - -

WebViewJavascriptBridge Demo

- -
- diff --git a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/AppDelegate.swift b/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/AppDelegate.swift deleted file mode 100644 index 808eae5c..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/AppDelegate.swift +++ /dev/null @@ -1,47 +0,0 @@ -// -// 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:. - } - - -} - diff --git a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 36d2c80d..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "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" - } -} \ No newline at end of file diff --git a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Base.lproj/LaunchScreen.storyboard b/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index fdf3f97d..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Base.lproj/Main.storyboard b/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Base.lproj/Main.storyboard deleted file mode 100644 index 273375fc..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Info.plist b/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Info.plist deleted file mode 100644 index d0524738..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/ViewController.swift b/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/ViewController.swift deleted file mode 100644 index f6eb0351..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOS/ViewController.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// 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. - } - - -} - diff --git a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOSTests/ExampleSwiftApp_iOSTests.swift b/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOSTests/ExampleSwiftApp_iOSTests.swift deleted file mode 100644 index c2a3b31a..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOSTests/ExampleSwiftApp_iOSTests.swift +++ /dev/null @@ -1,211 +0,0 @@ -// -// 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() - } - } - } - -} diff --git a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOSTests/Info.plist b/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOSTests/Info.plist deleted file mode 100644 index 6c6c23c4..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/ExampleSwiftApp-iOSTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/Example Apps/ExampleSwiftApp-iOS/Podfile b/Example Apps/ExampleSwiftApp-iOS/Podfile deleted file mode 100644 index 504f6f15..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Podfile +++ /dev/null @@ -1,18 +0,0 @@ -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 diff --git a/Example Apps/ExampleSwiftApp-iOS/Podfile.lock b/Example Apps/ExampleSwiftApp-iOS/Podfile.lock deleted file mode 100644 index 0f348683..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Podfile.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - WebViewJavascriptBridge (6.0.2) - -DEPENDENCIES: - - WebViewJavascriptBridge (from `../..`) - -EXTERNAL SOURCES: - WebViewJavascriptBridge: - :path: ../.. - -SPEC CHECKSUMS: - WebViewJavascriptBridge: 791ee0e26d1bf15efe5fb7fb9666a71a19b89d77 - -PODFILE CHECKSUM: f657cfcc5a24b7c7f0c7781719b73d4a834bc276 - -COCOAPODS: 1.1.1 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Local Podspecs/WebViewJavascriptBridge.podspec.json b/Example Apps/ExampleSwiftApp-iOS/Pods/Local Podspecs/WebViewJavascriptBridge.podspec.json deleted file mode 100644 index 5fb7055c..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Local Podspecs/WebViewJavascriptBridge.podspec.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "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" -} diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Manifest.lock b/Example Apps/ExampleSwiftApp-iOS/Pods/Manifest.lock deleted file mode 100644 index 0f348683..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Manifest.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - WebViewJavascriptBridge (6.0.2) - -DEPENDENCIES: - - WebViewJavascriptBridge (from `../..`) - -EXTERNAL SOURCES: - WebViewJavascriptBridge: - :path: ../.. - -SPEC CHECKSUMS: - WebViewJavascriptBridge: 791ee0e26d1bf15efe5fb7fb9666a71a19b89d77 - -PODFILE CHECKSUM: f657cfcc5a24b7c7f0c7781719b73d4a834bc276 - -COCOAPODS: 1.1.1 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Info.plist b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Info.plist deleted file mode 100644 index 2243fe6e..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-acknowledgements.markdown b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-acknowledgements.markdown deleted file mode 100644 index ce5d3d20..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-acknowledgements.markdown +++ /dev/null @@ -1,29 +0,0 @@ -# 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 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-acknowledgements.plist b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-acknowledgements.plist deleted file mode 100644 index ec65f732..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-acknowledgements.plist +++ /dev/null @@ -1,61 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - 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. - - License - MIT - Title - WebViewJavascriptBridge - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - https://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-dummy.m b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-dummy.m deleted file mode 100644 index 5736c16b..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_ExampleSwiftApp_iOS : NSObject -@end -@implementation PodsDummy_Pods_ExampleSwiftApp_iOS -@end diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-frameworks.sh b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-frameworks.sh deleted file mode 100755 index 43c5de29..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-frameworks.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/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 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-resources.sh b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-resources.sh deleted file mode 100755 index 25e9d377..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-resources.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/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 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-umbrella.h b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-umbrella.h deleted file mode 100644 index 7d2746cd..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS-umbrella.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - - -FOUNDATION_EXPORT double Pods_ExampleSwiftApp_iOSVersionNumber; -FOUNDATION_EXPORT const unsigned char Pods_ExampleSwiftApp_iOSVersionString[]; - diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.debug.xcconfig b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.debug.xcconfig deleted file mode 100644 index df30848c..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.debug.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -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 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.modulemap b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.modulemap deleted file mode 100644 index 4ab6cd4c..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Pods_ExampleSwiftApp_iOS { - umbrella header "Pods-ExampleSwiftApp-iOS-umbrella.h" - - export * - module * { export * } -} diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.release.xcconfig b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.release.xcconfig deleted file mode 100644 index df30848c..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOS/Pods-ExampleSwiftApp-iOS.release.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -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 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Info.plist b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Info.plist deleted file mode 100644 index 2243fe6e..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-acknowledgements.markdown b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-acknowledgements.markdown deleted file mode 100644 index ce5d3d20..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-acknowledgements.markdown +++ /dev/null @@ -1,29 +0,0 @@ -# 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 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-acknowledgements.plist b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-acknowledgements.plist deleted file mode 100644 index ec65f732..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-acknowledgements.plist +++ /dev/null @@ -1,61 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - 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. - - License - MIT - Title - WebViewJavascriptBridge - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - https://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-dummy.m b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-dummy.m deleted file mode 100644 index ef312438..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_ExampleSwiftApp_iOSTests : NSObject -@end -@implementation PodsDummy_Pods_ExampleSwiftApp_iOSTests -@end diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-frameworks.sh b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-frameworks.sh deleted file mode 100755 index 43c5de29..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-frameworks.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/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 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-resources.sh b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-resources.sh deleted file mode 100755 index 25e9d377..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-resources.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/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 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-umbrella.h b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-umbrella.h deleted file mode 100644 index e20d8d81..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests-umbrella.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - - -FOUNDATION_EXPORT double Pods_ExampleSwiftApp_iOSTestsVersionNumber; -FOUNDATION_EXPORT const unsigned char Pods_ExampleSwiftApp_iOSTestsVersionString[]; - diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.debug.xcconfig b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.debug.xcconfig deleted file mode 100644 index df30848c..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.debug.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -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 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.modulemap b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.modulemap deleted file mode 100644 index 1eac38ca..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Pods_ExampleSwiftApp_iOSTests { - umbrella header "Pods-ExampleSwiftApp-iOSTests-umbrella.h" - - export * - module * { export * } -} diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.release.xcconfig b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.release.xcconfig deleted file mode 100644 index df30848c..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/Pods-ExampleSwiftApp-iOSTests/Pods-ExampleSwiftApp-iOSTests.release.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -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 diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/Info.plist b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/Info.plist deleted file mode 100644 index 69f0d0ab..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 6.0.2 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-dummy.m b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-dummy.m deleted file mode 100644 index 6c5914c8..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_WebViewJavascriptBridge : NSObject -@end -@implementation PodsDummy_WebViewJavascriptBridge -@end diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-prefix.pch b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-prefix.pch deleted file mode 100644 index aa992a4a..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-prefix.pch +++ /dev/null @@ -1,4 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-umbrella.h b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-umbrella.h deleted file mode 100644 index 41f7d8e1..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-umbrella.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - -#import "WebViewJavascriptBridge.h" -#import "WebViewJavascriptBridgeBase.h" -#import "WKWebViewJavascriptBridge.h" - -FOUNDATION_EXPORT double WebViewJavascriptBridgeVersionNumber; -FOUNDATION_EXPORT const unsigned char WebViewJavascriptBridgeVersionString[]; - diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge.modulemap b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge.modulemap deleted file mode 100644 index e0cccd7e..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module WebViewJavascriptBridge { - umbrella header "WebViewJavascriptBridge-umbrella.h" - - export * - module * { export * } -} diff --git a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge.xcconfig b/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge.xcconfig deleted file mode 100644 index bc2e2b7a..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -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 diff --git a/Example Apps/ExampleSwiftApp-iOS/echo.html b/Example Apps/ExampleSwiftApp-iOS/echo.html deleted file mode 100644 index b5076d9f..00000000 --- a/Example Apps/ExampleSwiftApp-iOS/echo.html +++ /dev/null @@ -1,33 +0,0 @@ - - - -

WebViewJavascriptBridgeTests - echo.html

- - diff --git a/Makefile b/Makefile deleted file mode 100644 index 5a89b6ca..00000000 --- a/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -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 diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..992ccd8e --- /dev/null +++ b/Package.swift @@ -0,0 +1,27 @@ +// swift-tools-version:5.3 +import PackageDescription + +let package = Package( + name: "WebViewJavascriptBridge", + platforms: [ + .iOS(.v9), + .macOS(.v10_10) + ], + products: [ + .library( + name: "WKWebViewJavascriptBridge", + targets: ["WKWebViewJavascriptBridge"] + ), + ], + targets: [ + .target( + name: "WKWebViewJavascriptBridge", + path: "WebViewJavascriptBridge", + publicHeadersPath: ".", + cSettings: [ + .headerSearchPath("."), + .define("WKWEBVIEWJAVASCRIPTBRIDGE_MODULE", to: nil) + ] + ) + ] +) diff --git a/README.md b/README.md deleted file mode 100644 index fb14d2de..00000000 --- a/README.md +++ /dev/null @@ -1,238 +0,0 @@ -WebViewJavascriptBridge -======================= - -[![Circle CI](https://img.shields.io/circleci/project/github/marcuswestin/WebViewJavascriptBridge.svg)](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() -``` diff --git a/Roadmap.md b/Roadmap.md deleted file mode 100644 index 00e0e353..00000000 --- a/Roadmap.md +++ /dev/null @@ -1,105 +0,0 @@ -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! diff --git a/Tests/Default-568h@2x.png b/Tests/Default-568h@2x.png deleted file mode 100644 index 0891b7aa..00000000 Binary files a/Tests/Default-568h@2x.png and /dev/null differ diff --git a/Tests/WebViewJavascriptBridgeTestHost/AppDelegate.h b/Tests/WebViewJavascriptBridgeTestHost/AppDelegate.h deleted file mode 100644 index 00728f35..00000000 --- a/Tests/WebViewJavascriptBridgeTestHost/AppDelegate.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// AppDelegate.h -// WebViewJavascriptBridgeTestHost -// -// Created by Pieter De Baets on 18/04/2015. -// Copyright (c) 2015 marcuswestin. All rights reserved. -// - -#import - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end - diff --git a/Tests/WebViewJavascriptBridgeTestHost/AppDelegate.m b/Tests/WebViewJavascriptBridgeTestHost/AppDelegate.m deleted file mode 100644 index 5d903bf9..00000000 --- a/Tests/WebViewJavascriptBridgeTestHost/AppDelegate.m +++ /dev/null @@ -1,43 +0,0 @@ -// -// 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 diff --git a/Tests/WebViewJavascriptBridgeTestHost/Info.plist b/Tests/WebViewJavascriptBridgeTestHost/Info.plist deleted file mode 100644 index a8a64dab..00000000 --- a/Tests/WebViewJavascriptBridgeTestHost/Info.plist +++ /dev/null @@ -1,34 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - - diff --git a/Tests/WebViewJavascriptBridgeTestHost/WebViewJavascriptBridgeTestHost-Bridging-Header.h b/Tests/WebViewJavascriptBridgeTestHost/WebViewJavascriptBridgeTestHost-Bridging-Header.h deleted file mode 100644 index 40fc7472..00000000 --- a/Tests/WebViewJavascriptBridgeTestHost/WebViewJavascriptBridgeTestHost-Bridging-Header.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// 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 */ diff --git a/Tests/WebViewJavascriptBridgeTestHost/main.m b/Tests/WebViewJavascriptBridgeTestHost/main.m deleted file mode 100644 index d37bf5bd..00000000 --- a/Tests/WebViewJavascriptBridgeTestHost/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// WebViewJavascriptBridgeTestHost -// -// Created by Pieter De Baets on 18/04/2015. -// Copyright (c) 2015 marcuswestin. All rights reserved. -// - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/Tests/WebViewJavascriptBridgeTests/BridgeTests.m b/Tests/WebViewJavascriptBridgeTests/BridgeTests.m deleted file mode 100644 index 06a139ea..00000000 --- a/Tests/WebViewJavascriptBridgeTests/BridgeTests.m +++ /dev/null @@ -1,183 +0,0 @@ -// -// BridgeTests.m -// WKWebViewJavascriptBridge -// -// Created by Pieter De Baets on 18/04/2015. -// Copyright (c) 2015 marcuswestin. All rights reserved. -// - -#import - -#import "WebViewJavascriptBridge.h" -#import "AppDelegate.h" - -static NSString *const echoHandler = @"echoHandler"; - -@interface BridgeTests : XCTestCase -@end -@interface TestWebPageLoadDelegate : NSObject -@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 diff --git a/Tests/WebViewJavascriptBridgeTests/BridgeTests.swift b/Tests/WebViewJavascriptBridgeTests/BridgeTests.swift deleted file mode 100644 index 3964f6ad..00000000 --- a/Tests/WebViewJavascriptBridgeTests/BridgeTests.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// 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. - } - } - -} diff --git a/Tests/WebViewJavascriptBridgeTests/Info.plist b/Tests/WebViewJavascriptBridgeTests/Info.plist deleted file mode 100644 index ba72822e..00000000 --- a/Tests/WebViewJavascriptBridgeTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/Tests/WebViewJavascriptBridgeTests/WebViewJavascriptBridgeTests-Bridging-Header.h b/Tests/WebViewJavascriptBridgeTests/WebViewJavascriptBridgeTests-Bridging-Header.h deleted file mode 100644 index 1b2cb5d6..00000000 --- a/Tests/WebViewJavascriptBridgeTests/WebViewJavascriptBridgeTests-Bridging-Header.h +++ /dev/null @@ -1,4 +0,0 @@ -// -// Use this file to import your target's public headers that you would like to expose to Swift. -// - diff --git a/Tests/WebViewJavascriptBridgeTests/echo.html b/Tests/WebViewJavascriptBridgeTests/echo.html deleted file mode 100644 index 4549722d..00000000 --- a/Tests/WebViewJavascriptBridgeTests/echo.html +++ /dev/null @@ -1,32 +0,0 @@ - - - -

WebViewJavascriptBridgeTests - echo.html

- - diff --git a/WebViewJavascriptBridge.podspec b/WebViewJavascriptBridge.podspec deleted file mode 100644 index ee75de48..00000000 --- a/WebViewJavascriptBridge.podspec +++ /dev/null @@ -1,19 +0,0 @@ -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://github.com/marcuswestin/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 diff --git a/WebViewJavascriptBridge/WebViewJavascriptBridge.h b/WebViewJavascriptBridge/WebViewJavascriptBridge.h deleted file mode 100755 index 1b64bb4e..00000000 --- a/WebViewJavascriptBridge/WebViewJavascriptBridge.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// WebViewJavascriptBridge.h -// ExampleApp-iOS -// -// Created by Marcus Westin on 6/14/13. -// Copyright (c) 2013 Marcus Westin. All rights reserved. -// - -#import -#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 -#endif - -#if defined __MAC_OS_X_VERSION_MAX_ALLOWED - #define WVJB_PLATFORM_OSX - #define WVJB_WEBVIEW_TYPE WebView - #define WVJB_WEBVIEW_DELEGATE_TYPE NSObject - #define WVJB_WEBVIEW_DELEGATE_INTERFACE NSObject -#elif defined __IPHONE_OS_VERSION_MAX_ALLOWED - #import - #define WVJB_PLATFORM_IOS - #define WVJB_WEBVIEW_TYPE UIWebView - #define WVJB_WEBVIEW_DELEGATE_TYPE NSObject - #define WVJB_WEBVIEW_DELEGATE_INTERFACE NSObject -#endif - -@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 diff --git a/WebViewJavascriptBridge/WebViewJavascriptBridge.m b/WebViewJavascriptBridge/WebViewJavascriptBridge.m deleted file mode 100755 index e74a6e24..00000000 --- a/WebViewJavascriptBridge/WebViewJavascriptBridge.m +++ /dev/null @@ -1,211 +0,0 @@ -// -// 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]; -} - -#if defined WVJB_PLATFORM_OSX -/* 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)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]; - } -} - - - -#elif defined WVJB_PLATFORM_IOS -/* Platform specific internals: iOS - **********************************/ - -- (void) _platformSpecificSetup:(WVJB_WEBVIEW_TYPE*)webView { - _webView = webView; - _webView.delegate = self; - _base = [[WebViewJavascriptBridgeBase alloc] init]; - _base.delegate = self; -} - -- (void) _platformSpecificDealloc { - _webView.delegate = nil; -} - -- (void)webViewDidFinishLoad:(UIWebView *)webView { - if (webView != _webView) { return; } - - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { - [strongDelegate webViewDidFinishLoad:webView]; - } -} - -- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { - if (webView != _webView) { return; } - - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) { - [strongDelegate webView:webView didFailLoadWithError:error]; - } -} - -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { - if (webView != _webView) { return YES; } - - NSURL *url = [request URL]; - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - 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]; - } - return NO; - } else if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:shouldStartLoadWithRequest:navigationType:)]) { - return [strongDelegate webView:webView shouldStartLoadWithRequest:request navigationType:navigationType]; - } else { - return YES; - } -} - -- (void)webViewDidStartLoad:(UIWebView *)webView { - if (webView != _webView) { return; } - - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webViewDidStartLoad:)]) { - [strongDelegate webViewDidStartLoad:webView]; - } -} - -#endif - -@end diff --git a/WebViewJavascriptBridge/module.modulemap b/WebViewJavascriptBridge/module.modulemap new file mode 100644 index 00000000..59a66a18 --- /dev/null +++ b/WebViewJavascriptBridge/module.modulemap @@ -0,0 +1,4 @@ +module WKWebViewJavascriptBridge { + header "WKWebViewJavascriptBridge.h" + export * +} diff --git a/circle.yml b/circle.yml deleted file mode 100644 index af65f786..00000000 --- a/circle.yml +++ /dev/null @@ -1,10 +0,0 @@ -machine: - xcode: - version: 9.0 -# dependencies: -# override: -# - brew install kylef/formulae/swiftenv -# - swiftenv install 3.0 -test: - override: - - make test-circle-ci