34 lines
661 B
Swift
34 lines
661 B
Swift
//
|
||
// WorkoutsApp.swift
|
||
// Workouts
|
||
//
|
||
// Created by rzen on 7/11/25 at 5:04 PM.
|
||
//
|
||
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
|
||
//
|
||
|
||
|
||
import SwiftUI
|
||
import SwiftData
|
||
|
||
@main
|
||
struct WorkoutsApp: App {
|
||
let container: ModelContainer
|
||
|
||
init() {
|
||
var shouldCreateDefaults = false
|
||
self.container = WorkoutsContainer.create(shouldCreateDefaults: &shouldCreateDefaults)
|
||
|
||
if shouldCreateDefaults {
|
||
InitialData.create(modelContext: ModelContext(container))
|
||
}
|
||
}
|
||
|
||
var body: some Scene {
|
||
WindowGroup {
|
||
ContentView()
|
||
}
|
||
.modelContainer(container)
|
||
}
|
||
}
|