mirror of
https://github.com/metabolist/metatext.git
synced 2024-12-23 05:56:30 +00:00
32 lines
999 B
Swift
32 lines
999 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import AVKit
|
|
import ServiceLayer
|
|
import SwiftUI
|
|
import ViewModels
|
|
|
|
@main
|
|
struct MetatextApp: App {
|
|
@UIApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
|
|
|
|
init() {
|
|
try? AVAudioSession.sharedInstance().setCategory(.ambient, mode: .default)
|
|
try? ImageCacheConfiguration(environment: Self.environment).configure()
|
|
}
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
// swiftlint:disable:next force_try
|
|
RootView(viewModel: try! RootViewModel(
|
|
environment: Self.environment,
|
|
registerForRemoteNotifications: appDelegate.registerForRemoteNotifications))
|
|
}
|
|
}
|
|
}
|
|
|
|
private extension MetatextApp {
|
|
static let environment = AppEnvironment.live(
|
|
userNotificationCenter: .current(),
|
|
reduceMotion: { UIAccessibility.isReduceMotionEnabled },
|
|
autoplayVideos: { UIAccessibility.isVideoAutoplayEnabled })
|
|
}
|