2020-08-03 00:23:01 +02:00
|
|
|
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
struct AppEnvironment {
|
2020-08-12 09:24:39 +02:00
|
|
|
let session: Session
|
2020-08-12 11:01:21 +02:00
|
|
|
let webAuthSessionType: WebAuthSession.Type
|
|
|
|
let keychainServiceType: KeychainService.Type
|
2020-08-18 07:13:37 +02:00
|
|
|
let userDefaults: UserDefaults
|
|
|
|
let inMemoryContent: Bool
|
2020-08-21 04:29:01 +02:00
|
|
|
let attributedStringCache = AttributedStringCache()
|
2020-08-12 09:24:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
extension AppEnvironment {
|
|
|
|
static let live: Self = Self(
|
|
|
|
session: Session(configuration: .default),
|
2020-08-12 11:01:21 +02:00
|
|
|
webAuthSessionType: LiveWebAuthSession.self,
|
2020-08-18 07:13:37 +02:00
|
|
|
keychainServiceType: LiveKeychainService.self,
|
|
|
|
userDefaults: .standard,
|
|
|
|
inMemoryContent: false)
|
2020-08-03 00:23:01 +02:00
|
|
|
}
|