diff --git a/KDS/Package.swift b/KDS/Package.swift index 7b13f18d17..fba98b0cd0 100644 --- a/KDS/Package.swift +++ b/KDS/Package.swift @@ -34,8 +34,5 @@ let package = Package( .product(name: "SnapshotTesting", package: "swift-snapshot-testing") ] ) - ], - swiftLanguageModes: [ - .v5 ] ) diff --git a/KDS/Sources/KDS/Colors/SemanticColor.swift b/KDS/Sources/KDS/Colors/SemanticColor.swift index 1d48a6046a..94857df181 100644 --- a/KDS/Sources/KDS/Colors/SemanticColor.swift +++ b/KDS/Sources/KDS/Colors/SemanticColor.swift @@ -1,7 +1,7 @@ import SwiftUI import UIKit -public protocol AdaptiveColor { +public protocol AdaptiveColor: Sendable { /// Returns a dynamically-provided `UIColor`, which responds to light/dark mode. var dynamicColor: UIColor { get } } @@ -30,7 +30,7 @@ public extension AdaptiveColor { /// A semantic color from the Kickstarter design system, like "surface/primary". /// Includes a light and dark mode color pair, as well as an identifying title. -public struct SemanticColor: AdaptiveColor { +public struct SemanticColor: AdaptiveColor, Sendable { public let dynamicColor: UIColor public let name: String @@ -62,7 +62,7 @@ public struct SemanticColor: AdaptiveColor { } /// Used for old design system colors which can't be mapped directly to the Kickstarter color palette. -public struct LegacyColor: AdaptiveColor { +public struct LegacyColor: AdaptiveColor, Sendable { public let name: String public let dynamicColor: UIColor diff --git a/KDS/Sources/KDS/Controllers/ColorsView.swift b/KDS/Sources/KDS/Controllers/ColorsView.swift index f2575caa6c..924122a5fa 100644 --- a/KDS/Sources/KDS/Controllers/ColorsView.swift +++ b/KDS/Sources/KDS/Controllers/ColorsView.swift @@ -176,13 +176,13 @@ public struct ColorsView: View { } } -extension SemanticColor: @retroactive Identifiable { +extension SemanticColor: Identifiable { public var id: String { return self.name } } -extension LegacyColor: @retroactive Identifiable { +extension LegacyColor: Identifiable { public var id: String { return self.name } diff --git a/KDS/Sources/KDS/Fonts/InterFont.swift b/KDS/Sources/KDS/Fonts/InterFont.swift index 065aabaf92..0f1bebc63c 100644 --- a/KDS/Sources/KDS/Fonts/InterFont.swift +++ b/KDS/Sources/KDS/Fonts/InterFont.swift @@ -1,3 +1,4 @@ +import Synchronization import UIKit public enum InterFont: CustomFont, CaseIterable { @@ -75,15 +76,14 @@ public enum InterFont: CustomFont, CaseIterable { } } -var registeredInterfont = false - extension InterFont: CustomFontAccessible { + private static let registeredInterfont = Atomic(false) public static var isRegistered: Bool { get { - registeredInterfont + registeredInterfont.load(ordering: .acquiring) } set { - registeredInterfont = newValue + _ = registeredInterfont.exchange(newValue, ordering: .acquiringAndReleasing) } }