Skip to content

Commit

Permalink
fix: support xcode16+ios18
Browse files Browse the repository at this point in the history
  • Loading branch information
lanistor committed Sep 28, 2024
1 parent c6ce2d3 commit c8eb3ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions ios/Classes/InAppWebView/InAppWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1416,11 +1416,9 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate,
}
}

public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) {
public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@MainActor @Sendable (Any?, (any Error)?) -> Void)? = nil) {
if let applePayAPIEnabled = settings?.applePayAPIEnabled, applePayAPIEnabled {
if let completionHandler = completionHandler {
completionHandler(nil, nil)
}
completionHandler(nil, nil)
return
}
super.evaluateJavaScript(javaScriptString, completionHandler: completionHandler)
Expand Down
6 changes: 2 additions & 4 deletions macos/Classes/InAppWebView/InAppWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -841,11 +841,9 @@ public class InAppWebView: WKWebView, WKUIDelegate,
}
}

public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) {
public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@MainActor @Sendable (Any?, (any Error)?) -> Void)? = nil) {
if let applePayAPIEnabled = settings?.applePayAPIEnabled, applePayAPIEnabled {
if let completionHandler = completionHandler {
completionHandler(nil, nil)
}
completionHandler(nil, nil)
return
}
super.evaluateJavaScript(javaScriptString, completionHandler: completionHandler)
Expand Down

0 comments on commit c8eb3ab

Please sign in to comment.