Fix build in Swift 6

This commit is contained in:
Itay 2025-02-18 12:27:01 -03:00
parent 6ad25a1266
commit 0c85e76f2f
No known key found for this signature in database
GPG key ID: 5A84E4954135304B

View file

@ -109,21 +109,21 @@ struct ExampleList: View {
}
}
struct PresentInfoAction {
var action: (any Example.Type) -> ()
struct PresentInfoAction: Sendable {
var action: @MainActor (any Example.Type) -> ()
init(action: @escaping (any Example.Type) -> Void) {
init(action: @escaping @MainActor (any Example.Type) -> Void) {
self.action = action
}
func callAsFunction<T: Example>(_ type: T.Type) {
@MainActor func callAsFunction<T: Example>(_ type: T.Type) {
action(type)
}
}
extension EnvironmentValues {
struct PresentInfoActionKey: EnvironmentKey {
static var defaultValue: PresentInfoAction? = nil
struct PresentInfoActionKey: EnvironmentKey {
static let defaultValue: PresentInfoAction? = nil
}
var presentInfoAction: PresentInfoAction? {