Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update doafter for swift 6 #22

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "ee6d6be087c1c8e2ed6684d6a4f831d394852582ea94dc76e1bf4efa9f1768b8",
"originHash" : "0176ca547be3045c0dad664f8065b6354d9a070d44592acf4b047888e61a7f21",
"pins" : [
{
"identity" : "alamofire",
Expand All @@ -10,6 +10,15 @@
"version" : "5.10.1"
}
},
{
"identity" : "keychain-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/evgenyneu/keychain-swift.git",
"state" : {
"revision" : "5e1b02b6a9dac2a759a1d5dbc175c86bd192a608",
"version" : "24.0.0"
}
},
{
"identity" : "kingfisher",
"kind" : "remoteSourceControl",
Expand Down
10 changes: 6 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/Alamofire/Alamofire.git", exact: "5.10.1"),
.package(url: "https://github.com/onevcat/Kingfisher.git", exact: "8.1.0"),
.package(url: "https://github.com/siteline/swiftui-introspect", from: "1.3.0"),
.package(url: "https://github.com/Swinject/Swinject.git", from: "2.9.1"),
.package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.57.0")
.package(url: "https://github.com/siteline/swiftui-introspect", exact: "1.3.0"),
.package(url: "https://github.com/Swinject/Swinject.git", exact: "2.9.1"),
.package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", exact: "0.57.0"),
.package(url: "https://github.com/evgenyneu/keychain-swift.git", exact: "24.0.0")
],
targets: [
.target(
Expand All @@ -30,7 +31,8 @@ let package = Package(
.product(name: "Alamofire", package: "Alamofire"),
.product(name: "Kingfisher", package: "Kingfisher"),
.product(name: "SwiftUIIntrospect", package: "swiftui-introspect"),
.product(name: "Swinject", package: "Swinject")
.product(name: "Swinject", package: "Swinject"),
.product(name: "KeychainSwift", package: "keychain-swift")
],
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins")
Expand Down
8 changes: 6 additions & 2 deletions Sources/OEXFoundation/Extensions/DispatchQueue+App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@

import Foundation

public func doAfter(_ delay: TimeInterval? = nil, _ closure: @Sendable @escaping () -> Void) {
DispatchQueue.main.asyncAfter(deadline: .now() + (delay ?? 0), execute: closure)
@MainActor
public func doAfter(_ delay: TimeInterval? = nil, _ closure: @escaping () -> Void) {
Task {
try? await Task.sleep(for: .milliseconds((delay ?? 0) * 1000))
closure()
}
}

public func dispatchQueueMain(_ closure: @Sendable @escaping () -> Void) {
Expand Down