Skip to content

Commit f88a5cb

Browse files
author
Keuahn Lumanog
committed
Added @mainactor to support Swift 6
1 parent 0bbb7b8 commit f88a5cb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Sources/WKJavaScriptController/WKJavaScriptController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import WebKit
22

3-
private var javaScriptControllerKey: UInt8 = 0
3+
@MainActor private var javaScriptControllerKey: UInt8 = 0
44

55
public extension WKWebView {
66
var javaScriptController: WKJavaScriptController? {
@@ -270,7 +270,7 @@ open class WKJavaScriptController: NSObject {
270270
}
271271
}
272272

273-
fileprivate func injectTo(_ userContentController: WKUserContentController) {
273+
@MainActor fileprivate func injectTo(_ userContentController: WKUserContentController) {
274274
let userScripts = userContentController.userScripts.filter {
275275
!$0.source.hasPrefix(identifier)
276276
}
@@ -287,7 +287,7 @@ open class WKJavaScriptController: NSObject {
287287
isInjectRequired = false
288288
}
289289

290-
private func bridgeScript() -> WKUserScript {
290+
@MainActor private func bridgeScript() -> WKUserScript {
291291
var source = """
292292
window.\(name) = {
293293
\(ReserveKeyword.createUUID): function() {

0 commit comments

Comments
 (0)