metatext/Shared/MetatextApp.swift

32 lines
856 B
Swift
Raw Normal View History

2020-07-19 02:12:32 +00:00
// Copyright © 2020 Metabolist. All rights reserved.
2020-07-19 02:06:12 +00:00
import SwiftUI
@main
struct MetatextApp: App {
2020-08-02 22:23:01 +00:00
private let environment: AppEnvironment
init() {
2020-08-02 22:23:01 +00:00
let identityDatabase: IdentityDatabase
do {
try identityDatabase = IdentityDatabase()
} catch {
fatalError("Failed to initialize identity database")
}
2020-08-02 22:23:01 +00:00
environment = AppEnvironment(
2020-08-03 15:20:51 +00:00
URLSessionConfiguration: .default,
2020-08-02 22:23:01 +00:00
identityDatabase: identityDatabase,
preferences: Preferences(userDefaults: .standard),
secrets: Secrets(keychain: Keychain(service: "com.metabolist.metatext")),
webAuthSessionType: RealWebAuthSession.self)
}
2020-07-19 02:06:12 +00:00
var body: some Scene {
WindowGroup {
2020-08-03 15:20:51 +00:00
RootView(viewModel: RootViewModel(environment: environment))
2020-07-19 02:06:12 +00:00
}
}
}