1
0
mirror of https://github.com/metabolist/metatext synced 2024-12-24 08:50:51 +01:00
metatext-app-ios-iphone-ipad/Shared/MetatextApp.swift

35 lines
942 B
Swift
Raw Normal View History

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