├── SwiftJavaScriptCore.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── README.md ├── SwiftJavaScriptCore ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── demo.html ├── AppDelegate.swift └── ViewController.swift └── .gitignore /SwiftJavaScriptCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## SwiftJavaScriptCore 2 | iOS开发中,Swift使用JavaScriptCore与网页进行交互。 3 | 4 | 5 | ## 详细介绍 6 | 点击查看详细文档:[马燕龙个人博客](http://www.mayanlong.com/archives/2016/88.html) 7 | 8 | 9 | > 本文首发于[马燕龙个人博客](http://www.mayanlong.com "马燕龙个人博客"),欢迎分享,转载请标明出处。
10 | > 马燕龙个人博客:[http://www.mayanlong.com](http://www.mayanlong.com "马燕龙个人博客")
11 | > 马燕龙个人微博:[http://weibo.com/imayanlong](http://weibo.com/imayanlong "马燕龙个人微博")
12 | > 马燕龙Github主页:[https://github.com/yanlongma](https://github.com/yanlongma "马燕龙Github主页")
13 | 14 | 15 | ## 效果图 16 | ![Swift与JS交互效果](http://www.mayanlong.com/usr/uploads/2016/06/977912961.gif) 17 | 18 | 19 | -------------------------------------------------------------------------------- /SwiftJavaScriptCore/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /SwiftJavaScriptCore/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | # Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | 62 | .DS_Store -------------------------------------------------------------------------------- /SwiftJavaScriptCore/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SwiftJavaScriptCore/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SwiftJavaScriptCore/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Document 6 | 8 | 28 | 29 | 30 | 31 |


32 | 33 |
34 | js调用App的微信支付方法wxPay() 35 |
36 |
演示最基本的调用及参数传递
37 | 38 | 39 |
js调用App的微信分享方法wxShare()
44 |
演示字典参数的使用
45 | 46 | 47 |
48 | js调用App的弹出对话框方法showDialog() 49 |
50 |
演示传递多个参数的使用,注意js调用时的方法名
51 | 52 | 53 |
54 | js调用App的方法后 App再调用js函数执行回调 55 |
56 |
App调用js函数执行回调时 内容会改变
57 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /SwiftJavaScriptCore/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftJavaScriptCore 4 | // 5 | // Created by myl on 16/6/8. 6 | // Copyright © 2016年 Mayanlong. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /SwiftJavaScriptCore/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SwiftJavaScriptCore 4 | // 5 | // Created by myl on 16/6/8. 6 | // Copyright © 2016年 Mayanlong. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import JavaScriptCore 11 | 12 | // 定义协议SwiftJavaScriptDelegate 该协议必须遵守JSExport协议 13 | @objc protocol SwiftJavaScriptDelegate: JSExport { 14 | 15 | // js调用App的微信支付功能 演示最基本的用法 16 | func wxPay(_ orderNo: String) 17 | 18 | // js调用App的微信分享功能 演示字典参数的使用 19 | func wxShare(_ dict: [String: AnyObject]) 20 | 21 | // js调用App方法时传递多个参数 并弹出对话框 注意js调用时的函数名 22 | func showDialog(_ title: String, message: String) 23 | 24 | // js调用App的功能后 App再调用js函数执行回调 25 | func callHandler(_ handleFuncName: String) 26 | 27 | } 28 | 29 | // 定义一个模型 该模型实现SwiftJavaScriptDelegate协议 30 | @objc class SwiftJavaScriptModel: NSObject, SwiftJavaScriptDelegate { 31 | 32 | weak var controller: UIViewController? 33 | weak var jsContext: JSContext? 34 | 35 | func wxPay(_ orderNo: String) { 36 | 37 | print("订单号:", orderNo) 38 | 39 | // 调起微信支付逻辑 40 | } 41 | 42 | func wxShare(_ dict: [String: AnyObject]) { 43 | 44 | print("分享信息:", dict) 45 | 46 | // 调起微信分享逻辑 47 | } 48 | 49 | func showDialog(_ title: String, message: String) { 50 | 51 | let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) 52 | alert.addAction(UIAlertAction(title: "确定", style: .default, handler: nil)) 53 | self.controller?.present(alert, animated: true, completion: nil) 54 | } 55 | 56 | func callHandler(_ handleFuncName: String) { 57 | 58 | let jsHandlerFunc = self.jsContext?.objectForKeyedSubscript("\(handleFuncName)") 59 | let dict = ["name": "sean", "age": 18] as [String : Any] 60 | let _ = jsHandlerFunc?.call(withArguments: [dict]) 61 | } 62 | } 63 | 64 | 65 | class ViewController: UIViewController, UIWebViewDelegate { 66 | 67 | var webView: UIWebView! 68 | var jsContext: JSContext! 69 | 70 | override func viewDidLoad() { 71 | super.viewDidLoad() 72 | 73 | testJSContext() 74 | 75 | addWebView() 76 | } 77 | 78 | func testJSContext() { 79 | 80 | // 通过JSContext执行js代码 81 | let context: JSContext = JSContext() 82 | let result1: JSValue = context.evaluateScript("1 + 3") 83 | print(result1) // 输出4 84 | 85 | // 定义js变量和函数 86 | context.evaluateScript("var num1 = 10; var num2 = 20;") 87 | context.evaluateScript("function sum(param1, param2) { return param1 + param2; }") 88 | 89 | // 通过js方法名调用方法 90 | let result2 = context.evaluateScript("sum(num1, num2)") 91 | print(result2 as AnyObject) // 输出30 92 | 93 | // 通过下标来获取js方法并调用方法 94 | let squareFunc = context.objectForKeyedSubscript("sum") 95 | let result3 = squareFunc?.call(withArguments: [10, 20]).toString() 96 | print(result3 as AnyObject) // 输出30 97 | 98 | } 99 | 100 | func addWebView() { 101 | 102 | self.webView = UIWebView(frame: self.view.bounds) 103 | self.view.addSubview(self.webView) 104 | self.webView.delegate = self 105 | self.webView.scalesPageToFit = true 106 | 107 | // 加载本地Html页面 108 | let url = Bundle.main.url(forResource: "demo", withExtension: "html") 109 | let request = URLRequest(url: url!) 110 | 111 | // 加载网络Html页面 请设置允许Http请求 112 | //let url = NSURL(string: "http://www.mayanlong.com"); 113 | //let request = NSURLRequest(URL: url!) 114 | 115 | self.webView.loadRequest(request) 116 | } 117 | 118 | 119 | func webViewDidFinishLoad(_ webView: UIWebView) { 120 | 121 | 122 | self.jsContext = webView.value(forKeyPath: "documentView.webView.mainFrame.javaScriptContext") as! JSContext 123 | let model = SwiftJavaScriptModel() 124 | model.controller = self 125 | model.jsContext = self.jsContext 126 | 127 | // 这一步是将SwiftJavaScriptModel模型注入到JS中,在JS就可以通过WebViewJavascriptBridge调用我们暴露的方法了。 128 | self.jsContext.setObject(model, forKeyedSubscript: "WebViewJavascriptBridge" as NSCopying & NSObjectProtocol) 129 | 130 | // 注册到本地的Html页面中 131 | let url = Bundle.main.url(forResource: "demo", withExtension: "html") 132 | self.jsContext.evaluateScript(try? String(contentsOf: url!, encoding: String.Encoding.utf8)) 133 | 134 | // 注册到网络Html页面 请设置允许Http请求 135 | //let url = "http://www.mayanlong.com"; 136 | //let curUrl = self.webView.request?.URL?.absoluteString //WebView当前访问页面的链接 可动态注册 137 | //self.jsContext.evaluateScript(try? String(contentsOfURL: NSURL(string: url)!, encoding: NSUTF8StringEncoding)) 138 | 139 | self.jsContext.exceptionHandler = { (context, exception) in 140 | print("exception:", exception as Any) 141 | } 142 | } 143 | 144 | override func didReceiveMemoryWarning() { 145 | super.didReceiveMemoryWarning() 146 | } 147 | 148 | 149 | } 150 | 151 | -------------------------------------------------------------------------------- /SwiftJavaScriptCore.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2330DDBD1D07D04E00230385 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2330DDBC1D07D04E00230385 /* AppDelegate.swift */; }; 11 | 2330DDBF1D07D04E00230385 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2330DDBE1D07D04E00230385 /* ViewController.swift */; }; 12 | 2330DDC21D07D04E00230385 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2330DDC01D07D04E00230385 /* Main.storyboard */; }; 13 | 2330DDC41D07D04E00230385 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2330DDC31D07D04E00230385 /* Assets.xcassets */; }; 14 | 2330DDC71D07D04E00230385 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2330DDC51D07D04E00230385 /* LaunchScreen.storyboard */; }; 15 | 2330DDCF1D07D0E600230385 /* demo.html in Resources */ = {isa = PBXBuildFile; fileRef = 2330DDCE1D07D0E600230385 /* demo.html */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 2330DDB91D07D04E00230385 /* SwiftJavaScriptCore.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftJavaScriptCore.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 2330DDBC1D07D04E00230385 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21 | 2330DDBE1D07D04E00230385 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 22 | 2330DDC11D07D04E00230385 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 23 | 2330DDC31D07D04E00230385 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 24 | 2330DDC61D07D04E00230385 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 25 | 2330DDC81D07D04E00230385 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 26 | 2330DDCE1D07D0E600230385 /* demo.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = demo.html; sourceTree = ""; }; 27 | /* End PBXFileReference section */ 28 | 29 | /* Begin PBXFrameworksBuildPhase section */ 30 | 2330DDB61D07D04E00230385 /* Frameworks */ = { 31 | isa = PBXFrameworksBuildPhase; 32 | buildActionMask = 2147483647; 33 | files = ( 34 | ); 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXFrameworksBuildPhase section */ 38 | 39 | /* Begin PBXGroup section */ 40 | 2330DDB01D07D04E00230385 = { 41 | isa = PBXGroup; 42 | children = ( 43 | 2330DDBB1D07D04E00230385 /* SwiftJavaScriptCore */, 44 | 2330DDBA1D07D04E00230385 /* Products */, 45 | ); 46 | sourceTree = ""; 47 | }; 48 | 2330DDBA1D07D04E00230385 /* Products */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 2330DDB91D07D04E00230385 /* SwiftJavaScriptCore.app */, 52 | ); 53 | name = Products; 54 | sourceTree = ""; 55 | }; 56 | 2330DDBB1D07D04E00230385 /* SwiftJavaScriptCore */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 2330DDCE1D07D0E600230385 /* demo.html */, 60 | 2330DDBC1D07D04E00230385 /* AppDelegate.swift */, 61 | 2330DDBE1D07D04E00230385 /* ViewController.swift */, 62 | 2330DDC01D07D04E00230385 /* Main.storyboard */, 63 | 2330DDC31D07D04E00230385 /* Assets.xcassets */, 64 | 2330DDC51D07D04E00230385 /* LaunchScreen.storyboard */, 65 | 2330DDC81D07D04E00230385 /* Info.plist */, 66 | ); 67 | path = SwiftJavaScriptCore; 68 | sourceTree = ""; 69 | }; 70 | /* End PBXGroup section */ 71 | 72 | /* Begin PBXNativeTarget section */ 73 | 2330DDB81D07D04E00230385 /* SwiftJavaScriptCore */ = { 74 | isa = PBXNativeTarget; 75 | buildConfigurationList = 2330DDCB1D07D04E00230385 /* Build configuration list for PBXNativeTarget "SwiftJavaScriptCore" */; 76 | buildPhases = ( 77 | 2330DDB51D07D04E00230385 /* Sources */, 78 | 2330DDB61D07D04E00230385 /* Frameworks */, 79 | 2330DDB71D07D04E00230385 /* Resources */, 80 | ); 81 | buildRules = ( 82 | ); 83 | dependencies = ( 84 | ); 85 | name = SwiftJavaScriptCore; 86 | productName = SwiftJavaScriptCore; 87 | productReference = 2330DDB91D07D04E00230385 /* SwiftJavaScriptCore.app */; 88 | productType = "com.apple.product-type.application"; 89 | }; 90 | /* End PBXNativeTarget section */ 91 | 92 | /* Begin PBXProject section */ 93 | 2330DDB11D07D04E00230385 /* Project object */ = { 94 | isa = PBXProject; 95 | attributes = { 96 | LastSwiftUpdateCheck = 0720; 97 | LastUpgradeCheck = 0830; 98 | ORGANIZATIONNAME = Mayanlong; 99 | TargetAttributes = { 100 | 2330DDB81D07D04E00230385 = { 101 | CreatedOnToolsVersion = 7.2; 102 | LastSwiftMigration = 0830; 103 | }; 104 | }; 105 | }; 106 | buildConfigurationList = 2330DDB41D07D04E00230385 /* Build configuration list for PBXProject "SwiftJavaScriptCore" */; 107 | compatibilityVersion = "Xcode 3.2"; 108 | developmentRegion = English; 109 | hasScannedForEncodings = 0; 110 | knownRegions = ( 111 | en, 112 | Base, 113 | ); 114 | mainGroup = 2330DDB01D07D04E00230385; 115 | productRefGroup = 2330DDBA1D07D04E00230385 /* Products */; 116 | projectDirPath = ""; 117 | projectRoot = ""; 118 | targets = ( 119 | 2330DDB81D07D04E00230385 /* SwiftJavaScriptCore */, 120 | ); 121 | }; 122 | /* End PBXProject section */ 123 | 124 | /* Begin PBXResourcesBuildPhase section */ 125 | 2330DDB71D07D04E00230385 /* Resources */ = { 126 | isa = PBXResourcesBuildPhase; 127 | buildActionMask = 2147483647; 128 | files = ( 129 | 2330DDC71D07D04E00230385 /* LaunchScreen.storyboard in Resources */, 130 | 2330DDCF1D07D0E600230385 /* demo.html in Resources */, 131 | 2330DDC41D07D04E00230385 /* Assets.xcassets in Resources */, 132 | 2330DDC21D07D04E00230385 /* Main.storyboard in Resources */, 133 | ); 134 | runOnlyForDeploymentPostprocessing = 0; 135 | }; 136 | /* End PBXResourcesBuildPhase section */ 137 | 138 | /* Begin PBXSourcesBuildPhase section */ 139 | 2330DDB51D07D04E00230385 /* Sources */ = { 140 | isa = PBXSourcesBuildPhase; 141 | buildActionMask = 2147483647; 142 | files = ( 143 | 2330DDBF1D07D04E00230385 /* ViewController.swift in Sources */, 144 | 2330DDBD1D07D04E00230385 /* AppDelegate.swift in Sources */, 145 | ); 146 | runOnlyForDeploymentPostprocessing = 0; 147 | }; 148 | /* End PBXSourcesBuildPhase section */ 149 | 150 | /* Begin PBXVariantGroup section */ 151 | 2330DDC01D07D04E00230385 /* Main.storyboard */ = { 152 | isa = PBXVariantGroup; 153 | children = ( 154 | 2330DDC11D07D04E00230385 /* Base */, 155 | ); 156 | name = Main.storyboard; 157 | sourceTree = ""; 158 | }; 159 | 2330DDC51D07D04E00230385 /* LaunchScreen.storyboard */ = { 160 | isa = PBXVariantGroup; 161 | children = ( 162 | 2330DDC61D07D04E00230385 /* Base */, 163 | ); 164 | name = LaunchScreen.storyboard; 165 | sourceTree = ""; 166 | }; 167 | /* End PBXVariantGroup section */ 168 | 169 | /* Begin XCBuildConfiguration section */ 170 | 2330DDC91D07D04E00230385 /* Debug */ = { 171 | isa = XCBuildConfiguration; 172 | buildSettings = { 173 | ALWAYS_SEARCH_USER_PATHS = NO; 174 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 175 | CLANG_CXX_LIBRARY = "libc++"; 176 | CLANG_ENABLE_MODULES = YES; 177 | CLANG_ENABLE_OBJC_ARC = YES; 178 | CLANG_WARN_BOOL_CONVERSION = YES; 179 | CLANG_WARN_CONSTANT_CONVERSION = YES; 180 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 181 | CLANG_WARN_EMPTY_BODY = YES; 182 | CLANG_WARN_ENUM_CONVERSION = YES; 183 | CLANG_WARN_INFINITE_RECURSION = YES; 184 | CLANG_WARN_INT_CONVERSION = YES; 185 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 186 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 187 | CLANG_WARN_UNREACHABLE_CODE = YES; 188 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 189 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 190 | COPY_PHASE_STRIP = NO; 191 | DEBUG_INFORMATION_FORMAT = dwarf; 192 | ENABLE_STRICT_OBJC_MSGSEND = YES; 193 | ENABLE_TESTABILITY = YES; 194 | GCC_C_LANGUAGE_STANDARD = gnu99; 195 | GCC_DYNAMIC_NO_PIC = NO; 196 | GCC_NO_COMMON_BLOCKS = YES; 197 | GCC_OPTIMIZATION_LEVEL = 0; 198 | GCC_PREPROCESSOR_DEFINITIONS = ( 199 | "DEBUG=1", 200 | "$(inherited)", 201 | ); 202 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 203 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 204 | GCC_WARN_UNDECLARED_SELECTOR = YES; 205 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 206 | GCC_WARN_UNUSED_FUNCTION = YES; 207 | GCC_WARN_UNUSED_VARIABLE = YES; 208 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 209 | MTL_ENABLE_DEBUG_INFO = YES; 210 | ONLY_ACTIVE_ARCH = YES; 211 | SDKROOT = iphoneos; 212 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 213 | }; 214 | name = Debug; 215 | }; 216 | 2330DDCA1D07D04E00230385 /* Release */ = { 217 | isa = XCBuildConfiguration; 218 | buildSettings = { 219 | ALWAYS_SEARCH_USER_PATHS = NO; 220 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 221 | CLANG_CXX_LIBRARY = "libc++"; 222 | CLANG_ENABLE_MODULES = YES; 223 | CLANG_ENABLE_OBJC_ARC = YES; 224 | CLANG_WARN_BOOL_CONVERSION = YES; 225 | CLANG_WARN_CONSTANT_CONVERSION = YES; 226 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 227 | CLANG_WARN_EMPTY_BODY = YES; 228 | CLANG_WARN_ENUM_CONVERSION = YES; 229 | CLANG_WARN_INFINITE_RECURSION = YES; 230 | CLANG_WARN_INT_CONVERSION = YES; 231 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 232 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 233 | CLANG_WARN_UNREACHABLE_CODE = YES; 234 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 235 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 236 | COPY_PHASE_STRIP = NO; 237 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 238 | ENABLE_NS_ASSERTIONS = NO; 239 | ENABLE_STRICT_OBJC_MSGSEND = YES; 240 | GCC_C_LANGUAGE_STANDARD = gnu99; 241 | GCC_NO_COMMON_BLOCKS = YES; 242 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 243 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 244 | GCC_WARN_UNDECLARED_SELECTOR = YES; 245 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 246 | GCC_WARN_UNUSED_FUNCTION = YES; 247 | GCC_WARN_UNUSED_VARIABLE = YES; 248 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 249 | MTL_ENABLE_DEBUG_INFO = NO; 250 | SDKROOT = iphoneos; 251 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 252 | VALIDATE_PRODUCT = YES; 253 | }; 254 | name = Release; 255 | }; 256 | 2330DDCC1D07D04E00230385 /* Debug */ = { 257 | isa = XCBuildConfiguration; 258 | buildSettings = { 259 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 260 | INFOPLIST_FILE = SwiftJavaScriptCore/Info.plist; 261 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 262 | PRODUCT_BUNDLE_IDENTIFIER = com.mayanlong.SwiftJavaScriptCore; 263 | PRODUCT_NAME = "$(TARGET_NAME)"; 264 | SWIFT_VERSION = 3.0; 265 | }; 266 | name = Debug; 267 | }; 268 | 2330DDCD1D07D04E00230385 /* Release */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 272 | INFOPLIST_FILE = SwiftJavaScriptCore/Info.plist; 273 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 274 | PRODUCT_BUNDLE_IDENTIFIER = com.mayanlong.SwiftJavaScriptCore; 275 | PRODUCT_NAME = "$(TARGET_NAME)"; 276 | SWIFT_VERSION = 3.0; 277 | }; 278 | name = Release; 279 | }; 280 | /* End XCBuildConfiguration section */ 281 | 282 | /* Begin XCConfigurationList section */ 283 | 2330DDB41D07D04E00230385 /* Build configuration list for PBXProject "SwiftJavaScriptCore" */ = { 284 | isa = XCConfigurationList; 285 | buildConfigurations = ( 286 | 2330DDC91D07D04E00230385 /* Debug */, 287 | 2330DDCA1D07D04E00230385 /* Release */, 288 | ); 289 | defaultConfigurationIsVisible = 0; 290 | defaultConfigurationName = Release; 291 | }; 292 | 2330DDCB1D07D04E00230385 /* Build configuration list for PBXNativeTarget "SwiftJavaScriptCore" */ = { 293 | isa = XCConfigurationList; 294 | buildConfigurations = ( 295 | 2330DDCC1D07D04E00230385 /* Debug */, 296 | 2330DDCD1D07D04E00230385 /* Release */, 297 | ); 298 | defaultConfigurationIsVisible = 0; 299 | defaultConfigurationName = Release; 300 | }; 301 | /* End XCConfigurationList section */ 302 | }; 303 | rootObject = 2330DDB11D07D04E00230385 /* Project object */; 304 | } 305 | --------------------------------------------------------------------------------