wake-ios/wake/WakeApp.swift
2025-08-18 19:16:34 +08:00

58 lines
1.6 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import SwiftUI
import UIKit
import SwiftData
@main
struct WakeApp: App {
// init() {
// //
// print("\n=== ===")
// for family in UIFont.familyNames.sorted() {
// print("\n\(family):")
// for name in UIFont.fontNames(forFamilyName: family).sorted() {
// print(" - \(name)")
// }
// }
// }
// 使
let container: ModelContainer
init() {
do {
// 1.
container = try ModelContainer(for: Login.self)
} catch {
// 2.
let url = URL.applicationSupportDirectory.appending(path: "default.store")
if FileManager.default.fileExists(atPath: url.path) {
try? FileManager.default.removeItem(at: url)
}
// 3.
container = try! ModelContainer(for: Login.self)
}
}
var body: some Scene {
WindowGroup {
ContentView()
// SettingsView()
//
// TabView{
// ContentView()
// .tabItem{
// Label("wake", systemImage: "book")
// }
// SettingView()
// .tabItem{
// Label("setting", systemImage: "gear")
// }
// }
}
//
.modelContainer(container)
}
}