swiftui-multiplatform/Shared/WriteFreely_MultiPlatformApp.swift

30 lines
863 B
Swift
Raw Normal View History

2020-07-22 13:57:10 +00:00
import SwiftUI
@main
struct WriteFreely_MultiPlatformApp: App {
@StateObject private var preferences = PreferencesModel()
@StateObject private var account = AccountModel()
#if DEBUG
@StateObject private var store = testPostStore
#else
@StateObject private var store = PostStore()
#endif
2020-07-22 13:57:10 +00:00
var body: some Scene {
WindowGroup {
ContentView(postStore: store, preferences: preferences, account: account)
.preferredColorScheme(preferences.preferredColorScheme)
2020-07-22 13:57:10 +00:00
}
#if os(macOS)
Settings {
SettingsView(preferences: preferences, account: account)
.frame(minWidth: 300, maxWidth: 300, minHeight: 200, maxHeight: 200)
.padding()
.preferredColorScheme(preferences.preferredColorScheme)
}
#endif
2020-07-22 13:57:10 +00:00
}
}