Formatted the boilerplated code in the app as well as the unit and UI tests targets.

This commit is contained in:
2026-02-08 21:10:52 +01:00
parent d97b49a1bd
commit f587893ba6
5 changed files with 19 additions and 14 deletions
+4 -3
View File
@@ -1,17 +1,18 @@
import SwiftUI
import SwiftData
import SwiftUI
@main
struct TodosApp: App {
var sharedModelContainer: ModelContainer = {
let schema = Schema([
Item.self,
Item.self
])
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
do {
return try ModelContainer(for: schema, configurations: [modelConfiguration])
} catch {
}
catch {
fatalError("Could not create ModelContainer: \(error)")
}
}()
+7 -3
View File
@@ -1,9 +1,13 @@
import SwiftUI
import SwiftData
import SwiftUI
struct ContentView: View {
@Environment(\.modelContext) private var modelContext
@Query private var items: [Item]
@Environment(\.modelContext)
private var modelContext
@Query
private var items: [Item]
var body: some View {
NavigationSplitView {
+1 -1
View File
@@ -23,5 +23,5 @@ final class TodosUITestsLaunchTests: XCTestCase {
attachment.lifetime = .keepAlways
add(attachment)
}
}
}
+2 -2
View File
@@ -2,8 +2,8 @@ import Testing
struct TodosTests {
@Test func example() async throws {
@Test
func example() async throws {
// Write your test here and use APIs like `#expect(...)` to check expected conditions.
}
}