diff --git a/Sources/Xcore/Swift/Components/Concurrency/Task+Extensions.swift b/Sources/Xcore/Swift/Components/Concurrency/Task+Extensions.swift deleted file mode 100644 index 0bf07ace4..000000000 --- a/Sources/Xcore/Swift/Components/Concurrency/Task+Extensions.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// Xcore -// Copyright © 2022 Xcore -// MIT license, see LICENSE file for details -// - -import SwiftUI - -@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) -@available(iOS, introduced: 13.0, deprecated: 16, message: "Use sleep(for: .seconds()) directly.") -extension Task { - /// Suspends the current task for at least the given duration in seconds. - /// - /// If the task is canceled before the time ends, this function throws - /// `CancellationError`. - /// - /// This function doesn't block the underlying thread. - public static func sleep(seconds duration: TimeInterval) async throws { - try await sleep(nanoseconds: UInt64(TimeInterval(NSEC_PER_SEC) * duration)) - } -} diff --git a/Sources/Xcore/SwiftUI/Components/WebView/WebView.swift b/Sources/Xcore/SwiftUI/Components/WebView/WebView.swift index c9083ec55..133baf60d 100644 --- a/Sources/Xcore/SwiftUI/Components/WebView/WebView.swift +++ b/Sources/Xcore/SwiftUI/Components/WebView/WebView.swift @@ -150,7 +150,7 @@ extension WebView { $0.addAction(.valueChanged) { sender in Task { // Sleep under a second to properly show the control. - try await Task.sleep(seconds: 0.75) + try await Task.sleep(for: .seconds(0.75)) sender.endRefreshing() webView.reload() pullToRefreshHandler()