Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
Swift 6
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanPodymov committed Nov 1, 2024
1 parent 4b5913d commit b1425f3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
22 changes: 12 additions & 10 deletions Calcium/CalculatorClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion Calcium/MainReducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import BigNumber
import CalciumCommon
@preconcurrency import CalciumCommon
import ComposableArchitecture

enum MainReducerError: Error {
Expand Down
6 changes: 6 additions & 0 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ packages:
version: 1.5.1
targets:
CalciumApp:
settings:
base:
SWIFT_VERSION: '6'
type: application
platform: iOS
sources: [Calcium]
Expand All @@ -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]
Expand Down

0 comments on commit b1425f3

Please sign in to comment.