Iterable / swift-sdk

Iterable's iOS SDK. Receive and track pushes to Iterable from your iOS app.
https://iterable.com/
MIT License
85 stars 68 forks source link

Xcode 16 beta 2 throws error stating Type 'WKWebView' does not conform to protocol 'WebViewProtocol' #777

Open harish-suthar opened 6 days ago

harish-suthar commented 6 days ago

Xcode 16 beta 2 throws error stating Type 'WKWebView' does not conform to protocol 'WebViewProtocol'

Screenshot 2024-06-26 at 5 29 48 AM
harish-suthar commented 6 days ago
Screenshot 2024-06-26 at 5 21 47 PM

Adding the blank method implementation using protocol extension solved the issue temporary, but this is doable only if I use cocoapods with SPM we can't update the source code so.

mtzaquia commented 5 days ago

As @harish-suthar mentioned, if modifying the files is an option (I do not see this updated on 6.5.3, which is the latest release available), simply adding @MainActor to the function should suffice:

protocol WebViewProtocol {
    var view: UIView { get }
    var position: ViewPosition { get }
    @discardableResult func loadHTMLString(_ string: String, baseURL: URL?) -> WKNavigation?
    func set(position: ViewPosition)
    func set(navigationDelegate: WKNavigationDelegate?)
    func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@MainActor (Any?, Error?) -> Void)?) // <- HERE
    func layoutSubviews()
    func calculateHeight() -> Future<CGFloat, IterableError>
}

This lets you move forward without extensions.

Curiously enough, I get this error even if using @preconcurrency import IterableSDK, so I am unsure if there's another way to suppress it without SDK code changes.

Ayyanchira commented 5 days ago

Thank you for reporting @harish-suthar and for the suggestions @mtzaquia . We will have this updated.

Lancelotbronner commented 4 days ago

Just to highlight the importance of this issue, since we can't use previous versions of Xcode on Sequoia, any developers updating to the beta will no longer be able to build their apps unless forking.

powellmark-aceable commented 20 hours ago

Any update here? I'm currently blocked.

JonLz commented 8 hours ago

We are blocked as well and would appreciate an update! Hopefully it is straightforward enough and could warrant a patch release. Thanks.

acekevin commented 7 hours ago

Currently blocked, please advise. Reporting up to our rep.

jmonroe commented 5 hours ago

I am also blocked on this and reported it to Iterable.

jena-chakour commented 5 hours ago

Hey all, quick note that the Iterable team is looking into this. We will update asap; appreciate everyone's feedback on the issue-- let us know if any relevant changes or details come up