Skip to content

Commit c4e55e0

Browse files
committed
Fix build issue only happening in Xcode 16.0.0 specifically
1 parent 615aa53 commit c4e55e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/HandySwiftUI/Types/Views/WebView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ public struct WebView: View {
7474

7575
func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) {
7676
if let scrollOffsetOnPageLoad = parent.scrollOffsetOnPageLoad {
77-
delay(by: .milliseconds(250)) {
77+
Task {
78+
try await Task.sleep(for: .milliseconds(250))
7879
let scrollScript = "window.scrollBy({ top: \(scrollOffsetOnPageLoad.y), left: \(scrollOffsetOnPageLoad.x), behavior: 'smooth' });"
79-
webView.evaluateJavaScript(scrollScript, completionHandler: nil)
80+
try await webView.evaluateJavaScript(scrollScript)
8081
}
8182
}
8283
}

0 commit comments

Comments
 (0)