From 0c85e76f2f7970703f26e1b158b7c80b03f2656e Mon Sep 17 00:00:00 2001 From: Itay Date: Tue, 18 Feb 2025 12:27:01 -0300 Subject: [PATCH] Fix build in Swift 6 --- Example/Pow Example/ExampleList.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Example/Pow Example/ExampleList.swift b/Example/Pow Example/ExampleList.swift index f206829..bb47904 100644 --- a/Example/Pow Example/ExampleList.swift +++ b/Example/Pow Example/ExampleList.swift @@ -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(_ type: T.Type) { + @MainActor func callAsFunction(_ 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? {