- Initialize iOS project with 6-tab navigation structure - Configure custom Light/Dark themes and AppColors - Define SwiftData models for Tasks, Tags, Goals, and TrackingRecords - Setup relationships (Super/Sub tags) and cascade delete rules - Implement Observable TrackingEngine for real-time timer updates
38 lines
890 B
Swift
38 lines
890 B
Swift
//
|
|
// TallyFlowApp.swift
|
|
// TallyFlow
|
|
//
|
|
// Created by 송예찬 on 6/26/26.
|
|
//
|
|
|
|
import SwiftUI
|
|
import SwiftData
|
|
|
|
@main
|
|
struct TallyFlowApp: App {
|
|
private let preferences = AppPreferences()
|
|
|
|
var sharedModelContainer: ModelContainer = {
|
|
let schema = Schema([
|
|
TaskItem.self,
|
|
TagEntity.self,
|
|
GoalEntity.self,
|
|
TrackingRecord.self,
|
|
])
|
|
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
|
|
do {
|
|
return try ModelContainer(for: schema, configurations: [modelConfiguration])
|
|
} catch {
|
|
fatalError("Could not create ModelContainer: \(error)")
|
|
}
|
|
}()
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
ContentView()
|
|
.environment(preferences)
|
|
}
|
|
.modelContainer(sharedModelContainer)
|
|
}
|
|
}
|