From b1425f3e9c41b7f911a33a999d6192a054b90e4b Mon Sep 17 00:00:00 2001 From: Roman Podymov Date: Fri, 1 Nov 2024 12:55:29 +0100 Subject: [PATCH] Swift 6 --- Calcium/CalculatorClient.swift | 22 ++++++++++++---------- Calcium/MainReducer.swift | 2 +- project.yml | 6 ++++++ 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Calcium/CalculatorClient.swift b/Calcium/CalculatorClient.swift index fc09bec..c50d6a7 100644 --- a/Calcium/CalculatorClient.swift +++ b/Calcium/CalculatorClient.swift @@ -11,8 +11,8 @@ import ComposableArchitecture import Resolver @DependencyClient -struct CalculatorClient { - var calculateValue: (String, String, CalciumCommon.Operation) -> String = { _, _, _ in "" } +struct CalculatorClient: Sendable { + var calculateValue: @Sendable (String, String, CalciumCommon.Operation) -> String = { _, _, _ in "" } } extension DependencyValues { @@ -22,15 +22,17 @@ extension DependencyValues { } } -extension CalculatorClient: DependencyKey { - static let liveValue = CalculatorClient( - calculateValue: { - @Injected var calculator: Calculator +/* extension CalculatorClient: DependencyKey { + static let liveValue = CalculatorClient( + calculateValue: { + /*@Injected var calculator: Calculator - return calculator.calculateValue(lhs: $0, rhs: $1, operation: $2) - } - ) -} + return calculator.calculateValue(lhs: $0, rhs: $1, operation: $2)*/ + + // return "" + } + ) + } */ extension CalculatorClient: TestDependencyKey { static let previewValue = { diff --git a/Calcium/MainReducer.swift b/Calcium/MainReducer.swift index 0ba56ee..2a3f4a3 100644 --- a/Calcium/MainReducer.swift +++ b/Calcium/MainReducer.swift @@ -7,7 +7,7 @@ // import BigNumber -import CalciumCommon +@preconcurrency import CalciumCommon import ComposableArchitecture enum MainReducerError: Error { diff --git a/project.yml b/project.yml index ce820d8..925d21e 100644 --- a/project.yml +++ b/project.yml @@ -16,6 +16,9 @@ packages: version: 1.5.1 targets: CalciumApp: + settings: + base: + SWIFT_VERSION: '6' type: application platform: iOS sources: [Calcium] @@ -32,6 +35,9 @@ targets: - script: "mint run swiftlint" name: SwiftLint CalciumAppTests: + settings: + base: + SWIFT_VERSION: '6' type: bundle.unit-test platform: iOS sources: [CalciumTests]