Skip to content

Commit 42a8b8f

Browse files
committed
Fix compilation with Xcode 9 in Swift 4 mode
1 parent 435fcf9 commit 42a8b8f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

WKJavaScriptController/WKJavaScriptController.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,16 +279,12 @@ extension WKJavaScriptController: WKScriptMessageHandler {
279279
return
280280
}
281281

282-
let method = class_getInstanceMethod(target.classForCoder, bridge.nativeSelector)
283-
if method == nil {
282+
guard let method = class_getInstanceMethod(target.classForCoder, bridge.nativeSelector) else {
284283
log("An unimplemented method has been called. (selector: \(bridge.nativeSelector))")
285284
return
286285
}
287286

288287
let imp = method_getImplementation(method)
289-
if imp == nil { // Always false...?
290-
return
291-
}
292288

293289
func cast(_ arg: Arg) -> Arg {
294290
if let number = arg as? NSNumber,

0 commit comments

Comments
 (0)