From 43d18e1fcf30b3511d4d3dbab81f2b66355f5c19 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Fri, 22 May 2026 13:17:49 -0400 Subject: [PATCH] Bump package to 6.1 and handle concurrency --- Package.swift | 2 +- .../SkipUI/SkipUI/Animation/Transition.swift | 4 ++-- Sources/SkipUI/SkipUI/App/Scene.swift | 2 +- Sources/SkipUI/SkipUI/Color/Color.swift | 2 +- Sources/SkipUI/SkipUI/Commands/Actions.swift | 14 ++++++------ Sources/SkipUI/SkipUI/Commands/DragDrop.swift | 2 +- .../SkipUI/SkipUI/Commands/EditActions.swift | 2 +- .../SkipUI/Commands/KeyboardShortcut.swift | 4 ++-- Sources/SkipUI/SkipUI/Commands/Menu.swift | 6 ++--- Sources/SkipUI/SkipUI/Commands/Search.swift | 2 +- .../SkipUI/Commands/SubmitTriggers.swift | 2 +- Sources/SkipUI/SkipUI/Commands/Toolbar.swift | 16 +++++++------- .../SkipUI/Components/ProgressView.swift | 2 +- .../SkipUI/SkipUI/Compose/ComposeResult.swift | 2 +- .../SkipUI/Containers/DisclosureGroup.swift | 2 +- Sources/SkipUI/SkipUI/Containers/Form.swift | 2 +- Sources/SkipUI/SkipUI/Containers/List.swift | 2 +- .../SkipUI/SkipUI/Containers/Navigation.swift | 10 ++++----- .../SkipUI/SkipUI/Containers/ScrollView.swift | 2 +- .../SkipUI/SkipUI/Containers/TabView.swift | 10 ++++----- Sources/SkipUI/SkipUI/Containers/Table.swift | 2 +- Sources/SkipUI/SkipUI/Controls/Button.swift | 4 ++-- .../SkipUI/SkipUI/Controls/ControlGroup.swift | 2 +- .../SkipUI/SkipUI/Controls/DatePicker.swift | 4 ++-- Sources/SkipUI/SkipUI/Controls/Picker.swift | 2 +- Sources/SkipUI/SkipUI/Controls/Toggle.swift | 2 +- .../Environment/EnvironmentValues.swift | 2 +- Sources/SkipUI/SkipUI/Graphics/Gradient.swift | 2 +- .../SkipUI/SkipUI/Graphics/ShapeStyle.swift | 6 ++--- Sources/SkipUI/SkipUI/Layout/Alignment.swift | 14 ++++++------ Sources/SkipUI/SkipUI/Layout/Angle.swift | 4 ++-- Sources/SkipUI/SkipUI/Layout/Axis.swift | 2 +- Sources/SkipUI/SkipUI/Layout/Edge.swift | 2 +- .../SkipUI/Layout/HorizontalAlignment.swift | 2 +- .../SkipUI/SkipUI/Layout/HorizontalEdge.swift | 2 +- Sources/SkipUI/SkipUI/Layout/Layout.swift | 6 ++--- .../Layout/MatchedGeometryProperties.swift | 2 +- .../SkipUI/SkipUI/Layout/Presentation.swift | 6 ++--- .../SkipUI/Layout/ProposedViewSize.swift | 2 +- Sources/SkipUI/SkipUI/Layout/SafeArea.swift | 2 +- Sources/SkipUI/SkipUI/Layout/Unit.swift | 4 ++-- .../SkipUI/Layout/VerticalAlignment.swift | 2 +- .../SkipUI/SkipUI/Layout/VerticalEdge.swift | 2 +- .../SkipUI/SkipUI/System/Accessibility.swift | 20 ++++++++--------- .../SkipUI/System/ContentShapeKinds.swift | 2 +- .../SkipUI/SkipUI/System/EmptyModifier.swift | 2 +- .../SkipUI/SkipUI/System/EventModifiers.swift | 2 +- Sources/SkipUI/SkipUI/System/Gesture.swift | 2 +- .../SkipUI/SkipUI/System/KeyEquivalent.swift | 2 +- .../SkipUI/System/SensoryFeedback.swift | 2 +- Sources/SkipUI/SkipUI/Text/Font.swift | 12 +++++----- Sources/SkipUI/SkipUI/Text/Label.swift | 2 +- .../SkipUI/SkipUI/Text/LabeledContent.swift | 2 +- Sources/SkipUI/SkipUI/Text/Text.swift | 22 +++++++++---------- Sources/SkipUI/SkipUI/Text/TextEditor.swift | 2 +- Sources/SkipUI/SkipUI/Text/TextField.swift | 2 +- Sources/SkipUI/SkipUI/Text/TextInput.swift | 2 +- .../SkipUI/SkipUI/UIKit/UIApplication.swift | 6 ++--- .../SkipUI/SkipUI/UIKit/UIPasteboard.swift | 2 +- .../SkipUI/UIKit/UITextContentType.swift | 2 +- .../SkipUI/UIKit/UserNotifications.swift | 10 ++++----- 61 files changed, 132 insertions(+), 132 deletions(-) diff --git a/Package.swift b/Package.swift index 075b7515..c14ae9ad 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.1 import PackageDescription let package = Package( diff --git a/Sources/SkipUI/SkipUI/Animation/Transition.swift b/Sources/SkipUI/SkipUI/Animation/Transition.swift index c4a8278d..6994e640 100644 --- a/Sources/SkipUI/SkipUI/Animation/Transition.swift +++ b/Sources/SkipUI/SkipUI/Animation/Transition.swift @@ -74,7 +74,7 @@ extension Transition { #endif } -public struct ContentTransition : RawRepresentable, Equatable { +public struct ContentTransition : RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { @@ -428,7 +428,7 @@ public struct OffsetTransition : Transition { } // SKIP @bridge -public struct OpacityTransition : Transition { +public struct OpacityTransition : Transition, Sendable { static let shared = OpacityTransition() // SKIP @bridge diff --git a/Sources/SkipUI/SkipUI/App/Scene.swift b/Sources/SkipUI/SkipUI/App/Scene.swift index bf8496b7..db170c40 100644 --- a/Sources/SkipUI/SkipUI/App/Scene.swift +++ b/Sources/SkipUI/SkipUI/App/Scene.swift @@ -70,7 +70,7 @@ extension Scene { } } -public struct ScenePadding : Equatable { +public struct ScenePadding : Equatable, Sendable { public static let minimum = ScenePadding() } diff --git a/Sources/SkipUI/SkipUI/Color/Color.swift b/Sources/SkipUI/SkipUI/Color/Color.swift index daacfcf7..7476a03e 100644 --- a/Sources/SkipUI/SkipUI/Color/Color.swift +++ b/Sources/SkipUI/SkipUI/Color/Color.swift @@ -14,7 +14,7 @@ import androidx.compose.ui.unit.dp #endif // SKIP @bridge -public struct Color: ShapeStyle, Renderable, Hashable { +public struct Color: ShapeStyle, Renderable, Hashable, Sendable { #if SKIP public let colorImpl: @Composable () -> androidx.compose.ui.graphics.Color diff --git a/Sources/SkipUI/SkipUI/Commands/Actions.swift b/Sources/SkipUI/SkipUI/Commands/Actions.swift index 13bb6d83..8d36d58d 100644 --- a/Sources/SkipUI/SkipUI/Commands/Actions.swift +++ b/Sources/SkipUI/SkipUI/Commands/Actions.swift @@ -13,7 +13,7 @@ public struct DismissAction { self.action = action } - static let `default` = DismissAction(action: { }) + nonisolated(unsafe) static let `default` = DismissAction(action: { }) public func callAsFunction() { action() @@ -23,7 +23,7 @@ public struct DismissAction { // SKIP @bridge public struct OpenURLAction { // SKIP @bridge - public struct Result { + public struct Result: Sendable { // SKIP @bridge public let rawValue: Int // SKIP @bridge @@ -51,7 +51,7 @@ public struct OpenURLAction { // SKIP @bridge public let systemHandler: ((URL) throws -> Void)? - static let `default`: OpenURLAction = OpenURLAction(handler: { _ in Result.systemAction }) + nonisolated(unsafe) static let `default`: OpenURLAction = OpenURLAction(handler: { _ in Result.systemAction }) // SKIP @bridge public init(handler: @escaping (URL) -> Result) { @@ -91,10 +91,10 @@ public struct OpenURLAction { } // SKIP @bridge -public struct RefreshAction { - public let action: () async -> Void +public struct RefreshAction: Sendable { + public let action: @Sendable () async -> Void - public init(action: @escaping () async -> Void) { + public init(action: @Sendable @escaping () async -> Void) { self.action = action } @@ -122,7 +122,7 @@ public struct RefreshAction { } // SKIP @bridge - public func run(completion: @escaping () -> Void) { + public func run(completion: @Sendable @escaping () -> Void) { Task { await action() completion() diff --git a/Sources/SkipUI/SkipUI/Commands/DragDrop.swift b/Sources/SkipUI/SkipUI/Commands/DragDrop.swift index 0eb0294d..768e13a3 100644 --- a/Sources/SkipUI/SkipUI/Commands/DragDrop.swift +++ b/Sources/SkipUI/SkipUI/Commands/DragDrop.swift @@ -121,7 +121,7 @@ public enum DropOperation: Int, Hashable, Sendable { case move = 8 case delete = 16 - public struct Set : OptionSet, Hashable { + public struct Set : OptionSet, Hashable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Commands/EditActions.swift b/Sources/SkipUI/SkipUI/Commands/EditActions.swift index 51685acb..40c15760 100644 --- a/Sources/SkipUI/SkipUI/Commands/EditActions.swift +++ b/Sources/SkipUI/SkipUI/Commands/EditActions.swift @@ -3,7 +3,7 @@ #if !SKIP_BRIDGE import Foundation -public struct EditActions /* */ : OptionSet { +public struct EditActions /* */ : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Commands/KeyboardShortcut.swift b/Sources/SkipUI/SkipUI/Commands/KeyboardShortcut.swift index bd316927..f5b89204 100644 --- a/Sources/SkipUI/SkipUI/Commands/KeyboardShortcut.swift +++ b/Sources/SkipUI/SkipUI/Commands/KeyboardShortcut.swift @@ -2,8 +2,8 @@ // SPDX-License-Identifier: MPL-2.0 #if !SKIP_BRIDGE -public struct KeyboardShortcut : Hashable { - public enum Localization : Hashable { +public struct KeyboardShortcut : Hashable, Sendable { + public enum Localization : Hashable, Sendable { case automatic case withoutMirroring case custom diff --git a/Sources/SkipUI/SkipUI/Commands/Menu.swift b/Sources/SkipUI/SkipUI/Commands/Menu.swift index eb9a02ca..4e9b4145 100644 --- a/Sources/SkipUI/SkipUI/Commands/Menu.swift +++ b/Sources/SkipUI/SkipUI/Commands/Menu.swift @@ -246,7 +246,7 @@ public final class Menu : View, Renderable { #endif } -public struct MenuStyle: RawRepresentable, Equatable { +public struct MenuStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { @@ -257,7 +257,7 @@ public struct MenuStyle: RawRepresentable, Equatable { public static let button = MenuStyle(rawValue: 1) // For bridging } -public struct MenuActionDismissBehavior: RawRepresentable, Equatable { +public struct MenuActionDismissBehavior: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { @@ -270,7 +270,7 @@ public struct MenuActionDismissBehavior: RawRepresentable, Equatable { public static let disabled = MenuActionDismissBehavior(rawValue: 1) // For bridging } -public struct MenuOrder: RawRepresentable, Equatable, Hashable { +public struct MenuOrder: RawRepresentable, Equatable, Hashable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Commands/Search.swift b/Sources/SkipUI/SkipUI/Commands/Search.swift index cfab3cce..6a024ba2 100644 --- a/Sources/SkipUI/SkipUI/Commands/Search.swift +++ b/Sources/SkipUI/SkipUI/Commands/Search.swift @@ -70,7 +70,7 @@ extension View { } } -public struct SearchFieldPlacement : RawRepresentable { +public struct SearchFieldPlacement : RawRepresentable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Commands/SubmitTriggers.swift b/Sources/SkipUI/SkipUI/Commands/SubmitTriggers.swift index 9ba3b03d..85def2c5 100644 --- a/Sources/SkipUI/SkipUI/Commands/SubmitTriggers.swift +++ b/Sources/SkipUI/SkipUI/Commands/SubmitTriggers.swift @@ -2,7 +2,7 @@ // SPDX-License-Identifier: MPL-2.0 #if !SKIP_BRIDGE -public struct SubmitTriggers : OptionSet { +public struct SubmitTriggers : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Commands/Toolbar.swift b/Sources/SkipUI/SkipUI/Commands/Toolbar.swift index 4ace62d5..0518e673 100644 --- a/Sources/SkipUI/SkipUI/Commands/Toolbar.swift +++ b/Sources/SkipUI/SkipUI/Commands/Toolbar.swift @@ -214,13 +214,13 @@ public struct ToolbarSpacer : ToolbarContent, CustomizableToolbarContent, View, #endif } -public enum ToolbarCustomizationBehavior { +public enum ToolbarCustomizationBehavior: Sendable { case `default` case reorderable case disabled } -public struct ToolbarItemPlacement: RawRepresentable, Equatable { +public struct ToolbarItemPlacement: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { @@ -252,38 +252,38 @@ public struct ToolbarItemPlacement: RawRepresentable, Equatable { public static let largeSubtitle = ToolbarItemPlacement(rawValue: 18) // For bridging } -public enum ToolbarPlacement: Int, Equatable { +public enum ToolbarPlacement: Int, Equatable, Sendable { case automatic = 0 // For bridging case bottomBar = 1 // For bridging case navigationBar = 2 // For bridging case tabBar = 3 // For bridging } -public enum ToolbarRole { +public enum ToolbarRole: Sendable { case automatic case navigationStack case browser case editor } -public enum ToolbarTitleDisplayMode: Int { +public enum ToolbarTitleDisplayMode: Int, Sendable { case automatic = 0 // For bridging case large = 1 // For bridging case inlineLarge = 2 // For bridging case inline = 3 // For bridging } -public struct ToolbarCustomizationOptions : OptionSet { +public struct ToolbarCustomizationOptions : OptionSet, Sendable, Sendable { public let rawValue: Int public init(rawValue: Int) { self.rawValue = rawValue } - public static var alwaysAvailable = ToolbarCustomizationOptions(rawValue: 1 << 0) + public static let alwaysAvailable = ToolbarCustomizationOptions(rawValue: 1 << 0) } -public struct ToolbarDefaultItemKind : RawRepresentable { +public struct ToolbarDefaultItemKind : RawRepresentable, Sendable, Sendable { public let rawValue: Int // For bridging public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Components/ProgressView.swift b/Sources/SkipUI/SkipUI/Components/ProgressView.swift index 8ecb3601..831548f3 100644 --- a/Sources/SkipUI/SkipUI/Components/ProgressView.swift +++ b/Sources/SkipUI/SkipUI/Components/ProgressView.swift @@ -137,7 +137,7 @@ public struct ProgressView : View, Renderable { #endif } -public struct ProgressViewStyle: RawRepresentable, Equatable { +public struct ProgressViewStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Compose/ComposeResult.swift b/Sources/SkipUI/SkipUI/Compose/ComposeResult.swift index ad77c82a..a26bd42c 100644 --- a/Sources/SkipUI/SkipUI/Compose/ComposeResult.swift +++ b/Sources/SkipUI/SkipUI/Compose/ComposeResult.swift @@ -4,6 +4,6 @@ /// The result of composing content. /// /// Reserved for future use. Having a return value also expands recomposition scope. See `ComposeBuilder` for details. -public struct ComposeResult { +public struct ComposeResult: Sendable { public static let ok = ComposeResult() } diff --git a/Sources/SkipUI/SkipUI/Containers/DisclosureGroup.swift b/Sources/SkipUI/SkipUI/Containers/DisclosureGroup.swift index 9689257d..14ee3043 100644 --- a/Sources/SkipUI/SkipUI/Containers/DisclosureGroup.swift +++ b/Sources/SkipUI/SkipUI/Containers/DisclosureGroup.swift @@ -188,7 +188,7 @@ public struct DisclosureGroup : View, Renderable { #endif } -public struct DisclosureGroupStyle: RawRepresentable, Equatable { +public struct DisclosureGroupStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Containers/Form.swift b/Sources/SkipUI/SkipUI/Containers/Form.swift index 8274f84a..9c8f0a29 100644 --- a/Sources/SkipUI/SkipUI/Containers/Form.swift +++ b/Sources/SkipUI/SkipUI/Containers/Form.swift @@ -30,7 +30,7 @@ public struct Form : View { #endif } -public struct FormStyle: RawRepresentable, Equatable { +public struct FormStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Containers/List.swift b/Sources/SkipUI/SkipUI/Containers/List.swift index 9d37af99..1bab2243 100644 --- a/Sources/SkipUI/SkipUI/Containers/List.swift +++ b/Sources/SkipUI/SkipUI/Containers/List.swift @@ -747,7 +747,7 @@ struct ListStyling: Equatable { } #endif -public struct ListStyle: RawRepresentable, Equatable { +public struct ListStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Containers/Navigation.swift b/Sources/SkipUI/SkipUI/Containers/Navigation.swift index 9d287975..1682bdca 100644 --- a/Sources/SkipUI/SkipUI/Containers/Navigation.swift +++ b/Sources/SkipUI/SkipUI/Containers/Navigation.swift @@ -1140,16 +1140,16 @@ struct NavigationDestinationItemWrapper: View { let LocalNavigator: ProvidableCompositionLocal = compositionLocalOf { nil as Navigator? } #endif -public struct NavigationSplitViewStyle: RawRepresentable, Equatable { +public struct NavigationSplitViewStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { self.rawValue = rawValue } - public static var automatic = NavigationSplitViewStyle(rawValue: 0) - public static var balanced = NavigationSplitViewStyle(rawValue: 1) - public static var prominentDetail = NavigationSplitViewStyle(rawValue: 2) + public static let automatic = NavigationSplitViewStyle(rawValue: 0) + public static let balanced = NavigationSplitViewStyle(rawValue: 1) + public static let prominentDetail = NavigationSplitViewStyle(rawValue: 2) } public struct NavigationBarItem : Hashable { @@ -1556,7 +1556,7 @@ public struct NavigationLink : View, Renderable { let label: ComposeBuilder private static let minimumNavigationInterval = 0.35 - private static var lastNavigationTime = 0.0 + nonisolated(unsafe) private static var lastNavigationTime = 0.0 public init(value: Any?, @ViewBuilder label: () -> any View) { self.value = value diff --git a/Sources/SkipUI/SkipUI/Containers/ScrollView.swift b/Sources/SkipUI/SkipUI/Containers/ScrollView.swift index 93004915..caba052c 100644 --- a/Sources/SkipUI/SkipUI/Containers/ScrollView.swift +++ b/Sources/SkipUI/SkipUI/Containers/ScrollView.swift @@ -304,7 +304,7 @@ public struct ScrollTarget { } } -public struct PinnedScrollableViews : OptionSet { +public struct PinnedScrollableViews : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Containers/TabView.swift b/Sources/SkipUI/SkipUI/Containers/TabView.swift index ab2f7f54..24ea3be2 100644 --- a/Sources/SkipUI/SkipUI/Containers/TabView.swift +++ b/Sources/SkipUI/SkipUI/Containers/TabView.swift @@ -691,7 +691,7 @@ public struct PageTabViewStyle: TabViewStyle { public let indexDisplayMode: PageTabViewStyle.IndexDisplayMode - public struct IndexDisplayMode: RawRepresentable, Equatable { + public struct IndexDisplayMode: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { @@ -718,7 +718,7 @@ extension TabViewStyle where Self == PageTabViewStyle { // MARK: Tab -public struct TabBarMinimizeBehavior : RawRepresentable, Hashable { +public struct TabBarMinimizeBehavior : RawRepresentable, Hashable, Sendable { public let rawValue: Int public init(rawValue: Int) { @@ -913,19 +913,19 @@ public struct Tab : TabContent, Renderable { #endif } -public struct TabCustomizationBehavior : Equatable { +public struct TabCustomizationBehavior : Equatable, Sendable { public static let automatic = TabCustomizationBehavior() public static let reorderable = TabCustomizationBehavior() public static let disabled = TabCustomizationBehavior() } -public struct TabPlacement : Hashable { +public struct TabPlacement : Hashable, Sendable { public static let automatic = TabPlacement() public static let pinned = TabPlacement() public static let sidebarOnly = TabPlacement() } -public enum TabRole : Int, Hashable { +public enum TabRole : Int, Hashable, Sendable { case search = 1 // For bridging } diff --git a/Sources/SkipUI/SkipUI/Containers/Table.swift b/Sources/SkipUI/SkipUI/Containers/Table.swift index 400cf0d5..7eb0114f 100644 --- a/Sources/SkipUI/SkipUI/Containers/Table.swift +++ b/Sources/SkipUI/SkipUI/Containers/Table.swift @@ -470,7 +470,7 @@ extension View { } } -public struct TableStyle { +public struct TableStyle: Sendable { public static let automatic = TableStyle() @available(*, unavailable) public static let inset = TableStyle() diff --git a/Sources/SkipUI/SkipUI/Controls/Button.swift b/Sources/SkipUI/SkipUI/Controls/Button.swift index 14f4612a..a2371202 100644 --- a/Sources/SkipUI/SkipUI/Controls/Button.swift +++ b/Sources/SkipUI/SkipUI/Controls/Button.swift @@ -281,7 +281,7 @@ public struct Button : View, Renderable { #endif } -public struct ButtonStyle: RawRepresentable, Equatable { +public struct ButtonStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { @@ -313,7 +313,7 @@ public enum ButtonRole : Int, Equatable { case close = 4 // For bridging } -public struct ButtonSizing : RawRepresentable, Hashable { +public struct ButtonSizing : RawRepresentable, Hashable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Controls/ControlGroup.swift b/Sources/SkipUI/SkipUI/Controls/ControlGroup.swift index 59c5d811..f42a3ac5 100644 --- a/Sources/SkipUI/SkipUI/Controls/ControlGroup.swift +++ b/Sources/SkipUI/SkipUI/Controls/ControlGroup.swift @@ -31,7 +31,7 @@ public struct ControlGroup : View { #endif } -public struct ControlGroupStyle: RawRepresentable, Equatable { +public struct ControlGroupStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Controls/DatePicker.swift b/Sources/SkipUI/SkipUI/Controls/DatePicker.swift index 0a439446..1448a434 100644 --- a/Sources/SkipUI/SkipUI/Controls/DatePicker.swift +++ b/Sources/SkipUI/SkipUI/Controls/DatePicker.swift @@ -276,7 +276,7 @@ public struct DatePicker : View, Renderable { } #endif -public struct DatePickerComponents : OptionSet { +public struct DatePickerComponents : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { @@ -287,7 +287,7 @@ public struct DatePickerComponents : OptionSet { public static let date = DatePickerComponents(rawValue: 1 << 1) // For bridging } -public struct DatePickerStyle: RawRepresentable, Equatable { +public struct DatePickerStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Controls/Picker.swift b/Sources/SkipUI/SkipUI/Controls/Picker.swift index 59e9305a..a7020643 100644 --- a/Sources/SkipUI/SkipUI/Controls/Picker.swift +++ b/Sources/SkipUI/SkipUI/Controls/Picker.swift @@ -268,7 +268,7 @@ public final class Picker : View, Renderable { #endif } -public struct PickerStyle: RawRepresentable, Equatable { +public struct PickerStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Controls/Toggle.swift b/Sources/SkipUI/SkipUI/Controls/Toggle.swift index f3a0a700..bb036b3f 100644 --- a/Sources/SkipUI/SkipUI/Controls/Toggle.swift +++ b/Sources/SkipUI/SkipUI/Controls/Toggle.swift @@ -95,7 +95,7 @@ public struct Toggle : View, Renderable { #endif } -public struct ToggleStyle: RawRepresentable, Equatable { +public struct ToggleStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Environment/EnvironmentValues.swift b/Sources/SkipUI/SkipUI/Environment/EnvironmentValues.swift index 5f83c841..6722654e 100644 --- a/Sources/SkipUI/SkipUI/Environment/EnvironmentValues.swift +++ b/Sources/SkipUI/SkipUI/Environment/EnvironmentValues.swift @@ -45,7 +45,7 @@ public protocol EnvironmentKeyCompanion { // Model as a class because our implementation only holds the global environment keys, and so does not need to copy. // Each key handles its own scoping of values using Android's `CompositionLocal` system public final class EnvironmentValues { - public static let shared = EnvironmentValues() + nonisolated(unsafe) public static let shared = EnvironmentValues() #if SKIP // We type erase all keys and values. The alternative would be to reify these functions. diff --git a/Sources/SkipUI/SkipUI/Graphics/Gradient.swift b/Sources/SkipUI/SkipUI/Graphics/Gradient.swift index f50a467b..d2133f99 100644 --- a/Sources/SkipUI/SkipUI/Graphics/Gradient.swift +++ b/Sources/SkipUI/SkipUI/Graphics/Gradient.swift @@ -69,7 +69,7 @@ public struct Gradient : ShapeStyle, Hashable { } #endif - public struct ColorSpace : Hashable { + public struct ColorSpace : Hashable, Sendable { public static let device = Gradient.ColorSpace() public static let perceptual = Gradient.ColorSpace() } diff --git a/Sources/SkipUI/SkipUI/Graphics/ShapeStyle.swift b/Sources/SkipUI/SkipUI/Graphics/ShapeStyle.swift index d726bc2f..5c33b964 100644 --- a/Sources/SkipUI/SkipUI/Graphics/ShapeStyle.swift +++ b/Sources/SkipUI/SkipUI/Graphics/ShapeStyle.swift @@ -62,7 +62,7 @@ public struct AnyShapeStyle : ShapeStyle { } // SKIP @bridge -public struct ForegroundStyle : ShapeStyle { +public struct ForegroundStyle : ShapeStyle, Sendable { static let shared = ForegroundStyle() // SKIP @bridge @@ -91,7 +91,7 @@ extension ShapeStyle where Self == ForegroundStyle { } // SKIP @bridge -public struct BackgroundStyle : ShapeStyle { +public struct BackgroundStyle : ShapeStyle, Sendable { static let shared = BackgroundStyle() // SKIP @bridge @@ -128,7 +128,7 @@ extension ShapeStyle where Self == BackgroundStyle { } // SKIP @bridge -public struct TintShapeStyle : ShapeStyle { +public struct TintShapeStyle : ShapeStyle, Sendable { static let shared = TintShapeStyle() // SKIP @bridge diff --git a/Sources/SkipUI/SkipUI/Layout/Alignment.swift b/Sources/SkipUI/SkipUI/Layout/Alignment.swift index eb11e976..737bb4ce 100644 --- a/Sources/SkipUI/SkipUI/Layout/Alignment.swift +++ b/Sources/SkipUI/SkipUI/Layout/Alignment.swift @@ -3,7 +3,7 @@ #if !SKIP_BRIDGE // NOTE: Keep in sync with SkipSwiftUI.Alignment -public struct Alignment : Equatable { +public struct Alignment : Equatable, Sendable { public var horizontal: HorizontalAlignment public var vertical: VerticalAlignment @@ -17,12 +17,12 @@ public struct Alignment : Equatable { public static let bottomLeading = Alignment(horizontal: .leading, vertical: .bottom) public static let bottomTrailing = Alignment(horizontal: .trailing, vertical: .bottom) - public static var centerFirstTextBaseline = Alignment(horizontal: .center, vertical: .firstTextBaseline) - public static var centerLastTextBaseline = Alignment(horizontal: .center, vertical: .lastTextBaseline) - public static var leadingFirstTextBaseline = Alignment(horizontal: .leading, vertical: .firstTextBaseline) - public static var leadingLastTextBaseline = Alignment(horizontal: .leading, vertical: .lastTextBaseline) - public static var trailingFirstTextBaseline = Alignment(horizontal: .trailing, vertical: .firstTextBaseline) - public static var trailingLastTextBaseline = Alignment(horizontal: .trailing, vertical: .lastTextBaseline) + public static let centerFirstTextBaseline = Alignment(horizontal: .center, vertical: .firstTextBaseline) + public static let centerLastTextBaseline = Alignment(horizontal: .center, vertical: .lastTextBaseline) + public static let leadingFirstTextBaseline = Alignment(horizontal: .leading, vertical: .firstTextBaseline) + public static let leadingLastTextBaseline = Alignment(horizontal: .leading, vertical: .lastTextBaseline) + public static let trailingFirstTextBaseline = Alignment(horizontal: .trailing, vertical: .firstTextBaseline) + public static let trailingLastTextBaseline = Alignment(horizontal: .trailing, vertical: .lastTextBaseline) #if SKIP /// Return the Compose alignment equivalent. diff --git a/Sources/SkipUI/SkipUI/Layout/Angle.swift b/Sources/SkipUI/SkipUI/Layout/Angle.swift index 958506e3..d70da385 100644 --- a/Sources/SkipUI/SkipUI/Layout/Angle.swift +++ b/Sources/SkipUI/SkipUI/Layout/Angle.swift @@ -2,8 +2,8 @@ // SPDX-License-Identifier: MPL-2.0 #if !SKIP_BRIDGE -public struct Angle: Codable, Hashable { - public static var zero = Angle() +public struct Angle: Codable, Hashable, Sendable { + public static let zero = Angle() public var radians: Double public var degrees: Double { diff --git a/Sources/SkipUI/SkipUI/Layout/Axis.swift b/Sources/SkipUI/SkipUI/Layout/Axis.swift index d1fce234..91f60325 100644 --- a/Sources/SkipUI/SkipUI/Layout/Axis.swift +++ b/Sources/SkipUI/SkipUI/Layout/Axis.swift @@ -6,7 +6,7 @@ public enum Axis : Int, Hashable, CaseIterable { case horizontal = 1 // For bridging case vertical = 2 // For bridging - public struct Set : OptionSet, Hashable { + public struct Set : OptionSet, Hashable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Layout/Edge.swift b/Sources/SkipUI/SkipUI/Layout/Edge.swift index 2c44eeb6..3ab49b76 100644 --- a/Sources/SkipUI/SkipUI/Layout/Edge.swift +++ b/Sources/SkipUI/SkipUI/Layout/Edge.swift @@ -8,7 +8,7 @@ public enum Edge : Int, Hashable, CaseIterable { case bottom = 4 // For bridging case trailing = 8 // For bridging - public struct Set : OptionSet, Equatable, CustomStringConvertible { + public struct Set : OptionSet, Equatable, CustomStringConvertible, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Layout/HorizontalAlignment.swift b/Sources/SkipUI/SkipUI/Layout/HorizontalAlignment.swift index 8e52bc48..1476e07f 100644 --- a/Sources/SkipUI/SkipUI/Layout/HorizontalAlignment.swift +++ b/Sources/SkipUI/SkipUI/Layout/HorizontalAlignment.swift @@ -8,7 +8,7 @@ import struct CoreGraphics.CGFloat #endif // NOTE: Keep in sync with SkipSwiftUI.HorizontalAlignment -public struct HorizontalAlignment : Equatable { +public struct HorizontalAlignment : Equatable, Sendable { let key: String init(key: String) { diff --git a/Sources/SkipUI/SkipUI/Layout/HorizontalEdge.swift b/Sources/SkipUI/SkipUI/Layout/HorizontalEdge.swift index 56c5bb64..ec075af6 100644 --- a/Sources/SkipUI/SkipUI/Layout/HorizontalEdge.swift +++ b/Sources/SkipUI/SkipUI/Layout/HorizontalEdge.swift @@ -6,7 +6,7 @@ public enum HorizontalEdge : Int, CaseIterable, Codable, Hashable { case leading = 1 case trailing = 2 - public struct Set : OptionSet { + public struct Set : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Layout/Layout.swift b/Sources/SkipUI/SkipUI/Layout/Layout.swift index d302821c..d9c81821 100644 --- a/Sources/SkipUI/SkipUI/Layout/Layout.swift +++ b/Sources/SkipUI/SkipUI/Layout/Layout.swift @@ -2,16 +2,16 @@ // SPDX-License-Identifier: MPL-2.0 #if !SKIP_BRIDGE -public enum LayoutDirection : Int, Hashable, CaseIterable { +public enum LayoutDirection : Int, Hashable, CaseIterable, Sendable { case leftToRight = 0 // For bridging case rightToLeft = 1 // For bridging } -public enum LayoutDirectionBehavior : Hashable { +public enum LayoutDirectionBehavior : Hashable, Sendable { case fixed case mirrors(in: LayoutDirection) - public static var mirrors = LayoutDirectionBehavior.mirrors(in: .rightToLeft) + public static let mirrors = LayoutDirectionBehavior.mirrors(in: .rightToLeft) } /* diff --git a/Sources/SkipUI/SkipUI/Layout/MatchedGeometryProperties.swift b/Sources/SkipUI/SkipUI/Layout/MatchedGeometryProperties.swift index 0bf8ad18..03249f55 100644 --- a/Sources/SkipUI/SkipUI/Layout/MatchedGeometryProperties.swift +++ b/Sources/SkipUI/SkipUI/Layout/MatchedGeometryProperties.swift @@ -2,7 +2,7 @@ // SPDX-License-Identifier: MPL-2.0 #if !SKIP_BRIDGE -public struct MatchedGeometryProperties : OptionSet { +public struct MatchedGeometryProperties : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Layout/Presentation.swift b/Sources/SkipUI/SkipUI/Layout/Presentation.swift index e5a7d9af..4c5a48f8 100644 --- a/Sources/SkipUI/SkipUI/Layout/Presentation.swift +++ b/Sources/SkipUI/SkipUI/Layout/Presentation.swift @@ -668,7 +668,7 @@ final class DisableScrollToDismissConnection : NestedScrollConnection { } #endif -public enum PresentationAdaptation { +public enum PresentationAdaptation: Sendable { case automatic case none case popover @@ -676,7 +676,7 @@ public enum PresentationAdaptation { case fullScreenCover } -public struct PresentationBackgroundInteraction { +public struct PresentationBackgroundInteraction: Sendable { let enabled: Bool? let upThrough: PresentationDetent? @@ -697,7 +697,7 @@ public enum PresentationContentInteraction : Equatable { case scrolls } -public enum PresentationDetent : Hashable { +public enum PresentationDetent : Hashable, Sendable { case medium case large case fraction(CGFloat) diff --git a/Sources/SkipUI/SkipUI/Layout/ProposedViewSize.swift b/Sources/SkipUI/SkipUI/Layout/ProposedViewSize.swift index a3bbb6c9..065848c4 100644 --- a/Sources/SkipUI/SkipUI/Layout/ProposedViewSize.swift +++ b/Sources/SkipUI/SkipUI/Layout/ProposedViewSize.swift @@ -8,7 +8,7 @@ import struct CoreGraphics.CGSize #endif #endif -public struct ProposedViewSize : Equatable { +public struct ProposedViewSize : Equatable, Sendable { public var width: CGFloat? public var height: CGFloat? diff --git a/Sources/SkipUI/SkipUI/Layout/SafeArea.swift b/Sources/SkipUI/SkipUI/Layout/SafeArea.swift index e34abb2b..6b69aa51 100644 --- a/Sources/SkipUI/SkipUI/Layout/SafeArea.swift +++ b/Sources/SkipUI/SkipUI/Layout/SafeArea.swift @@ -8,7 +8,7 @@ import androidx.compose.ui.geometry.Rect import struct CoreGraphics.CGFloat #endif -public struct SafeAreaRegions : OptionSet { +public struct SafeAreaRegions : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Layout/Unit.swift b/Sources/SkipUI/SkipUI/Layout/Unit.swift index d2520bc6..438682e5 100644 --- a/Sources/SkipUI/SkipUI/Layout/Unit.swift +++ b/Sources/SkipUI/SkipUI/Layout/Unit.swift @@ -6,7 +6,7 @@ import androidx.compose.animation.core.CubicBezierEasing import androidx.compose.animation.core.Easing #endif -public struct UnitPoint : Codable, Hashable { +public struct UnitPoint : Codable, Hashable, Sendable { public var x = 0.0 public var y = 0.0 @@ -22,7 +22,7 @@ public struct UnitPoint : Codable, Hashable { public static let bottomTrailing = UnitPoint(x: 1.0, y: 1.0) } -public struct UnitCurve: Hashable { +public struct UnitCurve: Hashable, Sendable { private let startControlPoint: UnitPoint private let endControlPoint: UnitPoint diff --git a/Sources/SkipUI/SkipUI/Layout/VerticalAlignment.swift b/Sources/SkipUI/SkipUI/Layout/VerticalAlignment.swift index 4a4d9558..66b2af1a 100644 --- a/Sources/SkipUI/SkipUI/Layout/VerticalAlignment.swift +++ b/Sources/SkipUI/SkipUI/Layout/VerticalAlignment.swift @@ -8,7 +8,7 @@ import struct CoreGraphics.CGFloat #endif // NOTE: Keep in sync with SkipSwiftUI.VerticalAlignment -public struct VerticalAlignment : Equatable { +public struct VerticalAlignment : Equatable, Sendable { let key: String init(key: String) { diff --git a/Sources/SkipUI/SkipUI/Layout/VerticalEdge.swift b/Sources/SkipUI/SkipUI/Layout/VerticalEdge.swift index 52e60bb9..ce3137cc 100644 --- a/Sources/SkipUI/SkipUI/Layout/VerticalEdge.swift +++ b/Sources/SkipUI/SkipUI/Layout/VerticalEdge.swift @@ -6,7 +6,7 @@ public enum VerticalEdge : Int, Hashable, CaseIterable, Codable { case top = 1 // For bridging case bottom = 2 // For bridging - public struct Set : OptionSet { + public struct Set : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/System/Accessibility.swift b/Sources/SkipUI/SkipUI/System/Accessibility.swift index 5bc744ed..5e21186b 100644 --- a/Sources/SkipUI/SkipUI/System/Accessibility.swift +++ b/Sources/SkipUI/SkipUI/System/Accessibility.swift @@ -507,7 +507,7 @@ extension View { } } -public struct AccessibilityActionKind : Equatable { +public struct AccessibilityActionKind : Equatable, Sendable { public static let `default` = AccessibilityActionKind() public static let escape = AccessibilityActionKind() public static let magicTap = AccessibilityActionKind() @@ -519,12 +519,12 @@ public struct AccessibilityActionKind : Equatable { } } -public enum AccessibilityAdjustmentDirection : Hashable { +public enum AccessibilityAdjustmentDirection : Hashable, Sendable { case increment case decrement } -public enum AccessibilityChildBehavior : Hashable { +public enum AccessibilityChildBehavior : Hashable, Sendable { case ignore, contain, combine } @@ -545,7 +545,7 @@ public struct AccessibilityCustomContentKey : Equatable { } } -public struct AccessibilityDirectTouchOptions : OptionSet { +public struct AccessibilityDirectTouchOptions : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { @@ -556,7 +556,7 @@ public struct AccessibilityDirectTouchOptions : OptionSet { public static let requiresActivation = AccessibilityDirectTouchOptions(rawValue: 2) } -public enum AccessibilityHeadingLevel : Int { +public enum AccessibilityHeadingLevel : Int, Sendable { case unspecified = 0 // For bridging case h1 = 1 // For bridging case h2 = 2 // For bridging @@ -566,7 +566,7 @@ public enum AccessibilityHeadingLevel : Int { case h6 = 6 // For bridging } -public enum AccessibilityLabeledPairRole : Hashable { +public enum AccessibilityLabeledPairRole : Hashable, Sendable { case label case content } @@ -616,7 +616,7 @@ public struct AccessibilityRotorEntry: AccessibilityRotorContent where ID : } } -public struct AccessibilitySystemRotor { +public struct AccessibilitySystemRotor: Sendable { public static func links(visited: Bool) -> AccessibilitySystemRotor { return AccessibilitySystemRotor() } @@ -639,7 +639,7 @@ public struct AccessibilitySystemRotor { public static let landmarks = AccessibilitySystemRotor() } -public struct AccessibilityTechnologies : OptionSet { +public struct AccessibilityTechnologies : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { @@ -650,11 +650,11 @@ public struct AccessibilityTechnologies : OptionSet { public static let switchControl = AccessibilityTechnologies(rawValue: 2) } -public enum AccessibilityTextContentType { +public enum AccessibilityTextContentType: Sendable { case plain, console, fileSystem, messaging, narrative, sourceCode, spreadsheet, wordProcessing } -public struct AccessibilityTraits : OptionSet { +public struct AccessibilityTraits : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/System/ContentShapeKinds.swift b/Sources/SkipUI/SkipUI/System/ContentShapeKinds.swift index b6916017..042fbbb5 100644 --- a/Sources/SkipUI/SkipUI/System/ContentShapeKinds.swift +++ b/Sources/SkipUI/SkipUI/System/ContentShapeKinds.swift @@ -2,7 +2,7 @@ // SPDX-License-Identifier: MPL-2.0 #if !SKIP_BRIDGE -public struct ContentShapeKinds : OptionSet { +public struct ContentShapeKinds : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/System/EmptyModifier.swift b/Sources/SkipUI/SkipUI/System/EmptyModifier.swift index 4dd6bf49..7ec096bf 100644 --- a/Sources/SkipUI/SkipUI/System/EmptyModifier.swift +++ b/Sources/SkipUI/SkipUI/System/EmptyModifier.swift @@ -8,7 +8,7 @@ import skip.model.StateTracking // SKIP @bridge public struct EmptyModifier : ViewModifier { - public static let identity: EmptyModifier = EmptyModifier() + nonisolated(unsafe) public static let identity: EmptyModifier = EmptyModifier() // SKIP @bridge public init() { diff --git a/Sources/SkipUI/SkipUI/System/EventModifiers.swift b/Sources/SkipUI/SkipUI/System/EventModifiers.swift index 2907d570..8d3fe6fe 100644 --- a/Sources/SkipUI/SkipUI/System/EventModifiers.swift +++ b/Sources/SkipUI/SkipUI/System/EventModifiers.swift @@ -2,7 +2,7 @@ // SPDX-License-Identifier: MPL-2.0 #if !SKIP_BRIDGE -@frozen public struct EventModifiers : OptionSet, Hashable { +@frozen public struct EventModifiers : OptionSet, Hashable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/System/Gesture.swift b/Sources/SkipUI/SkipUI/System/Gesture.swift index 1c110970..416e6850 100644 --- a/Sources/SkipUI/SkipUI/System/Gesture.swift +++ b/Sources/SkipUI/SkipUI/System/Gesture.swift @@ -407,7 +407,7 @@ public struct SpatialTapGesture : Gesture { } } -public struct GestureMask : OptionSet { +public struct GestureMask : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/System/KeyEquivalent.swift b/Sources/SkipUI/SkipUI/System/KeyEquivalent.swift index 4896e945..fe1f71d3 100644 --- a/Sources/SkipUI/SkipUI/System/KeyEquivalent.swift +++ b/Sources/SkipUI/SkipUI/System/KeyEquivalent.swift @@ -2,7 +2,7 @@ // SPDX-License-Identifier: MPL-2.0 #if !SKIP_BRIDGE -public struct KeyEquivalent : Hashable { +public struct KeyEquivalent : Hashable, Sendable { public let character: Character public init(_ character: Character) { diff --git a/Sources/SkipUI/SkipUI/System/SensoryFeedback.swift b/Sources/SkipUI/SkipUI/System/SensoryFeedback.swift index e01394cf..a2f2498d 100644 --- a/Sources/SkipUI/SkipUI/System/SensoryFeedback.swift +++ b/Sources/SkipUI/SkipUI/System/SensoryFeedback.swift @@ -5,7 +5,7 @@ import android.os.VibrationEffect #endif -public struct SensoryFeedback : RawRepresentable, Equatable { +public struct SensoryFeedback : RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Text/Font.swift b/Sources/SkipUI/SkipUI/Text/Font.swift index ba5d296b..ea24da7a 100644 --- a/Sources/SkipUI/SkipUI/Text/Font.swift +++ b/Sources/SkipUI/SkipUI/Text/Font.swift @@ -414,7 +414,7 @@ public struct Font : Hashable { } } - public struct Resolved : Hashable { + public struct Resolved : Hashable, Sendable { public let ctFont: Int /* CTFont */ public let isBold: Bool public let isItalic: Bool @@ -428,7 +428,7 @@ public struct Font : Hashable { public let isSmallCaps: Bool } - public struct Weight : Hashable { + public struct Weight : Hashable, Sendable { let value: Int public static let ultraLight = Weight(value: -3) // For bridging (-0.8) public static let thin = Weight(value: -2) // For bridging (-0.6) @@ -441,7 +441,7 @@ public struct Font : Hashable { public static let black = Weight(value: 5) // For bridging (0.62) } - public struct Width : Hashable { + public struct Width : Hashable, Sendable { public var value: CGFloat public init(_ value: CGFloat) { @@ -454,13 +454,13 @@ public struct Font : Hashable { public static let expanded = Width(1.2) } - public enum Leading : Hashable { + public enum Leading : Hashable, Sendable { case standard case tight case loose } - public enum Design : Int, Hashable { + public enum Design : Int, Hashable, Sendable { case `default` = 0 // For bridging case serif = 1 // For bridging case rounded = 2 // For bridging @@ -485,7 +485,7 @@ public struct Font : Hashable { #endif } -public enum LegibilityWeight : Hashable { +public enum LegibilityWeight : Hashable, Sendable { case regular case bold } diff --git a/Sources/SkipUI/SkipUI/Text/Label.swift b/Sources/SkipUI/SkipUI/Text/Label.swift index 0e910e5f..18c22876 100644 --- a/Sources/SkipUI/SkipUI/Text/Label.swift +++ b/Sources/SkipUI/SkipUI/Text/Label.swift @@ -132,7 +132,7 @@ public struct Label : View, Renderable { #endif } -public struct LabelStyle: RawRepresentable, Equatable { +public struct LabelStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Text/LabeledContent.swift b/Sources/SkipUI/SkipUI/Text/LabeledContent.swift index 3eb29a1c..32fc6f4d 100644 --- a/Sources/SkipUI/SkipUI/Text/LabeledContent.swift +++ b/Sources/SkipUI/SkipUI/Text/LabeledContent.swift @@ -82,7 +82,7 @@ public struct LabeledContent : View, Renderable { #endif } -public struct LabeledContentStyle: RawRepresentable, Equatable { +public struct LabeledContentStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Text/Text.swift b/Sources/SkipUI/SkipUI/Text/Text.swift index afc18e42..af281df1 100644 --- a/Sources/SkipUI/SkipUI/Text/Text.swift +++ b/Sources/SkipUI/SkipUI/Text/Text.swift @@ -266,12 +266,12 @@ public struct Text: View, Renderable, Equatable { return self } - public enum Case : Int, Equatable { + public enum Case : Int, Equatable, Sendable { case uppercase = 0 // For bridging case lowercase = 1 // For bridging } - public struct LineStyle : Hashable { + public struct LineStyle : Hashable, Sendable { public let pattern: Text.LineStyle.Pattern public let color: Color? @@ -280,7 +280,7 @@ public struct Text: View, Renderable, Equatable { self.color = color } - public enum Pattern { + public enum Pattern: Sendable { case solid case dot case dash @@ -291,18 +291,18 @@ public struct Text: View, Renderable, Equatable { public static let single = Text.LineStyle() } - public enum Scale : Hashable { + public enum Scale : Hashable, Sendable { case `default` case secondary } - public enum TruncationMode: Int { + public enum TruncationMode: Int, Sendable { case head = 1 // For bridging case tail = 2 // For bridging case middle = 3 // For bridging } - public struct DateStyle { + public struct DateStyle: @unsafe Sendable { public static let time = DateStyle(format: { date in let formatter = DateFormatter() formatter.timeStyle = .medium @@ -324,21 +324,21 @@ public struct Text: View, Renderable, Equatable { @available(*, unavailable) public static let timer = DateStyle(format: { _ in fatalError() }) - let format: (Date) -> String + let format: @Sendable (Date) -> String - private init(format: @escaping (Date) -> String) { + private init(format: @Sendable @escaping (Date) -> String) { self.format = format } } - public struct WritingDirectionStrategy : Hashable { + public struct WritingDirectionStrategy : Hashable, Sendable { @available(*, unavailable) public static let layoutBased = WritingDirectionStrategy() public static let contentBased = WritingDirectionStrategy() public static let `default` = WritingDirectionStrategy() } - public struct AlignmentStrategy : Hashable { + public struct AlignmentStrategy : Hashable, Sendable { @available(*, unavailable) public static let layoutBased = AlignmentStrategy() @available(*, unavailable) @@ -983,7 +983,7 @@ public struct Material3TextOptions { } #endif -public struct RedactionReasons : OptionSet { +public struct RedactionReasons : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Text/TextEditor.swift b/Sources/SkipUI/SkipUI/Text/TextEditor.swift index f7ae41fa..f86dd49b 100644 --- a/Sources/SkipUI/SkipUI/Text/TextEditor.swift +++ b/Sources/SkipUI/SkipUI/Text/TextEditor.swift @@ -60,7 +60,7 @@ public struct TextEditor : View, Renderable { #endif } -public struct TextEditorStyle: RawRepresentable, Equatable { +public struct TextEditorStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Text/TextField.swift b/Sources/SkipUI/SkipUI/Text/TextField.swift index e2028cd9..55002bb2 100644 --- a/Sources/SkipUI/SkipUI/Text/TextField.swift +++ b/Sources/SkipUI/SkipUI/Text/TextField.swift @@ -196,7 +196,7 @@ public struct TextField : View, Renderable { #endif } -public struct TextFieldStyle: RawRepresentable, Equatable { +public struct TextFieldStyle: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/Text/TextInput.swift b/Sources/SkipUI/SkipUI/Text/TextInput.swift index f18bd222..c86ab3c6 100644 --- a/Sources/SkipUI/SkipUI/Text/TextInput.swift +++ b/Sources/SkipUI/SkipUI/Text/TextInput.swift @@ -28,7 +28,7 @@ public enum TextInputAutocapitalization: Int { } public struct TextInputFormattingControlPlacement { - public struct Set : OptionSet { + public struct Set : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/UIKit/UIApplication.swift b/Sources/SkipUI/SkipUI/UIKit/UIApplication.swift index a9f5c80a..1d1a6513 100644 --- a/Sources/SkipUI/SkipUI/UIKit/UIApplication.swift +++ b/Sources/SkipUI/SkipUI/UIKit/UIApplication.swift @@ -32,7 +32,7 @@ let logger: Logger = Logger(subsystem: "skip.ui", category: "SkipUI") // adb log // SKIP @bridge /* @MainActor */ public class UIApplication /* : UIResponder */ { // SKIP @bridge - public static let shared = UIApplication() + nonisolated(unsafe) public static let shared = UIApplication() #if SKIP private var requestPermissionLauncher: ActivityResultLauncher? private let waitingContinuations: MutableList> = mutableListOf>() @@ -432,7 +432,7 @@ let logger: Logger = Logger(subsystem: "skip.ui", category: "SkipUI") // adb log } // NOTE: Keep in sync with SkipSwiftUI.UIApplication.State - public enum State : Int { + public enum State : Int, Sendable { case active = 0 case inactive = 1 case background = 2 @@ -447,7 +447,7 @@ let logger: Logger = Logger(subsystem: "skip.ui", category: "SkipUI") // adb log fatalError() } - public struct OpenExternalURLOptionsKey : Hashable, Equatable, RawRepresentable { + public struct OpenExternalURLOptionsKey : Hashable, Equatable, RawRepresentable, Sendable { public let rawValue: String public init(rawValue: String) { self.rawValue = rawValue diff --git a/Sources/SkipUI/SkipUI/UIKit/UIPasteboard.swift b/Sources/SkipUI/SkipUI/UIKit/UIPasteboard.swift index 664597d5..5f019cc8 100644 --- a/Sources/SkipUI/SkipUI/UIKit/UIPasteboard.swift +++ b/Sources/SkipUI/SkipUI/UIKit/UIPasteboard.swift @@ -12,7 +12,7 @@ import android.content.Context.CLIPBOARD_SERVICE // SKIP @bridge public class UIPasteboard { // SKIP @bridge - public static let general = UIPasteboard() + nonisolated(unsafe) public static let general = UIPasteboard() private init() { #if SKIP diff --git a/Sources/SkipUI/SkipUI/UIKit/UITextContentType.swift b/Sources/SkipUI/SkipUI/UIKit/UITextContentType.swift index a3d24a02..5ac51ef6 100644 --- a/Sources/SkipUI/SkipUI/UIKit/UITextContentType.swift +++ b/Sources/SkipUI/SkipUI/UIKit/UITextContentType.swift @@ -2,7 +2,7 @@ // SPDX-License-Identifier: MPL-2.0 #if !SKIP_BRIDGE -public struct UITextContentType: RawRepresentable, Equatable { +public struct UITextContentType: RawRepresentable, Equatable, Sendable { public let rawValue: Int public init(rawValue: Int) { diff --git a/Sources/SkipUI/SkipUI/UIKit/UserNotifications.swift b/Sources/SkipUI/SkipUI/UIKit/UserNotifications.swift index acc3fae8..b5a54f8d 100644 --- a/Sources/SkipUI/SkipUI/UIKit/UserNotifications.swift +++ b/Sources/SkipUI/SkipUI/UIKit/UserNotifications.swift @@ -32,7 +32,7 @@ import kotlin.random.Random // SKIP @bridge public final class UNUserNotificationCenter { - private static let shared = UNUserNotificationCenter() + nonisolated(unsafe) private static let shared = UNUserNotificationCenter() private init() { } @@ -335,7 +335,7 @@ extension UNUserNotificationCenterDelegate { } } -public struct UNAuthorizationOptions : OptionSet { +public struct UNAuthorizationOptions : OptionSet, Sendable { public let rawValue: Int public init(rawValue: Int) { @@ -348,7 +348,7 @@ public struct UNAuthorizationOptions : OptionSet { public static let carPlay = UNAuthorizationOptions(rawValue: 1 << 3) // For bridging public static let criticalAlert = UNAuthorizationOptions(rawValue: 1 << 4) // For bridging public static let providesAppNotificationSettings = UNAuthorizationOptions(rawValue: 1 << 5) // For bridging - public static var provisional = UNAuthorizationOptions(rawValue: 1 << 6) // For bridging + public static let provisional = UNAuthorizationOptions(rawValue: 1 << 6) // For bridging } // SKIP @bridge @@ -409,7 +409,7 @@ public final class UNNotificationResponse { } // SKIP @bridge -public struct UNNotificationPresentationOptions : OptionSet { +public struct UNNotificationPresentationOptions : OptionSet, Sendable { // SKIP @bridge public let rawValue: Int @@ -587,7 +587,7 @@ public final class UNNotificationSound { } } -public struct UNNotificationSoundName: RawRepresentable, Hashable { +public struct UNNotificationSoundName: RawRepresentable, Hashable, Sendable { public let rawValue: String public init(rawValue: String) {