From 1ef11338e976bd52da7df3eb9a001f07eb3e8eb4 Mon Sep 17 00:00:00 2001 From: Dan Federman Date: Sun, 24 Dec 2023 16:44:11 -0800 Subject: [PATCH] Turn on strict concurrency checking in sample project --- .../ExampleProjectIntegration.xcodeproj/project.pbxproj | 2 ++ .../ExampleProjectIntegration/Views/ExampleApp.swift | 1 + .../ExampleProjectIntegration/Views/NameEntryView.swift | 1 + .../ExampleProjectIntegration/Views/NoteView.swift | 1 + 4 files changed, 5 insertions(+) diff --git a/Examples/ExampleProjectIntegration/ExampleProjectIntegration.xcodeproj/project.pbxproj b/Examples/ExampleProjectIntegration/ExampleProjectIntegration.xcodeproj/project.pbxproj index 6fca89ec..c6f12098 100644 --- a/Examples/ExampleProjectIntegration/ExampleProjectIntegration.xcodeproj/project.pbxproj +++ b/Examples/ExampleProjectIntegration/ExampleProjectIntegration.xcodeproj/project.pbxproj @@ -262,6 +262,7 @@ ONLY_ACTIVE_ARCH = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_STRICT_CONCURRENCY = complete; }; name = Debug; }; @@ -316,6 +317,7 @@ MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_STRICT_CONCURRENCY = complete; }; name = Release; }; diff --git a/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/ExampleApp.swift b/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/ExampleApp.swift index 97915118..e752bddb 100644 --- a/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/ExampleApp.swift +++ b/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/ExampleApp.swift @@ -24,6 +24,7 @@ import SwiftUI // @Instantiable macro marks this type as capable of being instantiated by SafeDI. @Instantiable +@MainActor @main public struct NotesApp: App { public var body: some Scene { diff --git a/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/NameEntryView.swift b/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/NameEntryView.swift index dd111293..9ed6d09f 100644 --- a/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/NameEntryView.swift +++ b/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/NameEntryView.swift @@ -21,6 +21,7 @@ import SafeDI import SwiftUI +@MainActor @Instantiable public struct NameEntryView: View { public init(userService: any UserService) { diff --git a/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/NoteView.swift b/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/NoteView.swift index 4cbaf05e..26ff2b1f 100644 --- a/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/NoteView.swift +++ b/Examples/ExampleProjectIntegration/ExampleProjectIntegration/Views/NoteView.swift @@ -21,6 +21,7 @@ import SafeDI import SwiftUI +@MainActor @Instantiable public struct NoteView: View { public init(userName: String, userService: any UserService, stringStorage: StringStorage) {