metatext/Shared/MetatextApp.swift

35 lines
1 KiB
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 {
private let identityDatabase: IdentityDatabase
private let keychainServive = KeychainService(serviceName: "com.metabolist.metatext")
private let environment = AppEnvironment(
URLSessionConfiguration: .default,
webAuthSessionType: WebAuthSession.self)
init() {
do {
try identityDatabase = IdentityDatabase()
} catch {
fatalError("Failed to initialize identity database")
}
}
2020-07-19 02:06:12 +00:00
var body: some Scene {
WindowGroup {
RootView(
viewModel: RootViewModel(identitiesService: IdentitiesService(
identityDatabase: identityDatabase,
keychainService: keychainServive,
environment: environment)))
2020-07-19 02:06:12 +00:00
}
}
}
2020-08-09 02:52:41 +00:00
private extension MetatextApp {
static let keychainServiceName = "com.metabolist.metatext"
}