Skip to content

Commit

Permalink
change: fixed Xcode 14 build error
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeEagle committed Jun 29, 2022
1 parent ee1b0d7 commit 06f87e8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ios/Classes/Types/UserScript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,19 @@ import WebKit

public class UserScript : WKUserScript {
var groupName: String?

var contentWorldWrapper: Any?
@available(iOS 14.0, *)
lazy var contentWorld: WKContentWorld = WKContentWorld.page
var contentWorld: WKContentWorld {
get {
if let value = contentWorldWrapper as? WKContentWorld {
return value
}
return .page
}
set { contentWorldWrapper = newValue }
}


public override init(source: String, injectionTime: WKUserScriptInjectionTime, forMainFrameOnly: Bool) {
super.init(source: source, injectionTime: injectionTime, forMainFrameOnly: forMainFrameOnly)
Expand Down

0 comments on commit 06f87e8

Please sign in to comment.