Skip to content

Commit 8c000cf

Browse files
committed
Fix build error with Xcode 9
1 parent d7eb726 commit 8c000cf

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
Calling native code from Javascript in iOS likes JavascriptInterface in Android.
33

44
## Requirements
5-
- Xcode 8.0+
5+
- Xcode 9.0+
66
- Swift 3
77
- iOS8+
88

9-
(based on WKJavaScriptController 1.1.0+)
9+
(based on WKJavaScriptController 1.1.7+)
1010

1111
## Installation
1212
This library is distributed by [CocoaPods](https://cocoapods.org).
1313

1414
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
15-
15+
1616
```
1717
$ gem install cocoapods
1818
```
@@ -102,5 +102,5 @@ native.onSubmit({
102102
- Method argument length is up to 10.
103103
- Allowed argument types are NSNumber, NSString, NSDate, NSArray, NSDictionary, and NSNull(when `undefined` passed).
104104
- If Value types of Swift(Bool, Int32, Int, Float, Double, ...) used in argument that are not wrapped in NSArray or NSDictionary, it must be replaced with JSBool, JSInt or JSFloat.
105-
(Because Value types of Swift in ObjC is replaced by NSNumber.)
105+
(Because Value types of Swift in ObjC is replaced by NSNumber.)
106106
- Class methods in protocol are not supported.

WKJavaScriptController-Demo/WKJavaScriptController-Demo.xcodeproj/project.pbxproj

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
isa = PBXProject;
126126
attributes = {
127127
LastSwiftUpdateCheck = 0820;
128-
LastUpgradeCheck = 0820;
128+
LastUpgradeCheck = 0900;
129129
ORGANIZATIONNAME = "Davin Ahn";
130130
TargetAttributes = {
131131
83FA35891E2C5C6900A6B171 = {
@@ -271,15 +271,21 @@
271271
CLANG_CXX_LIBRARY = "libc++";
272272
CLANG_ENABLE_MODULES = YES;
273273
CLANG_ENABLE_OBJC_ARC = YES;
274+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
274275
CLANG_WARN_BOOL_CONVERSION = YES;
276+
CLANG_WARN_COMMA = YES;
275277
CLANG_WARN_CONSTANT_CONVERSION = YES;
276278
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
277279
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
278280
CLANG_WARN_EMPTY_BODY = YES;
279281
CLANG_WARN_ENUM_CONVERSION = YES;
280282
CLANG_WARN_INFINITE_RECURSION = YES;
281283
CLANG_WARN_INT_CONVERSION = YES;
284+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
285+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
282286
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
287+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
288+
CLANG_WARN_STRICT_PROTOTYPES = YES;
283289
CLANG_WARN_SUSPICIOUS_MOVE = YES;
284290
CLANG_WARN_UNREACHABLE_CODE = YES;
285291
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -320,15 +326,21 @@
320326
CLANG_CXX_LIBRARY = "libc++";
321327
CLANG_ENABLE_MODULES = YES;
322328
CLANG_ENABLE_OBJC_ARC = YES;
329+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
323330
CLANG_WARN_BOOL_CONVERSION = YES;
331+
CLANG_WARN_COMMA = YES;
324332
CLANG_WARN_CONSTANT_CONVERSION = YES;
325333
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
326334
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
327335
CLANG_WARN_EMPTY_BODY = YES;
328336
CLANG_WARN_ENUM_CONVERSION = YES;
329337
CLANG_WARN_INFINITE_RECURSION = YES;
330338
CLANG_WARN_INT_CONVERSION = YES;
339+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
340+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
331341
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
342+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
343+
CLANG_WARN_STRICT_PROTOTYPES = YES;
332344
CLANG_WARN_SUSPICIOUS_MOVE = YES;
333345
CLANG_WARN_UNREACHABLE_CODE = YES;
334346
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;

WKJavaScriptController/WKJavaScriptController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ open class WKJavaScriptController: NSObject {
130130
var protocols = [`protocol`]
131131
let protocolList = protocol_copyProtocolList(`protocol`, nil)
132132
if protocolList != nil, let list = Optional(protocolList) {
133-
if let adoptedProtocol = list?.pointee.unsafelyUnwrapped {
133+
if let adoptedProtocol = list?.pointee {
134134
protocols += protocolsAdoptedBy(protocol: adoptedProtocol)
135135
}
136136
}

0 commit comments

Comments
 (0)