Impressia/Vernissage/Models/ApplicationState.swift

30 lines
771 B
Swift
Raw Normal View History

2022-12-30 18:20:54 +01:00
//
// https://mczachurski.dev
// Copyright © 2022 Marcin Czachurski and the repository contributors.
// Licensed under the MIT License.
//
import Foundation
2023-01-12 18:34:48 +01:00
import SwiftUI
2023-01-10 20:38:02 +01:00
import MastodonKit
2022-12-30 18:20:54 +01:00
public class ApplicationState: ObservableObject {
public static let shared = ApplicationState()
2023-01-06 13:05:21 +01:00
private init() { }
2023-01-10 20:38:02 +01:00
2022-12-30 18:20:54 +01:00
@Published var accountData: AccountData?
2023-01-12 18:34:48 +01:00
@Published var tintColor = TintColor.accentColor2
2023-01-13 13:37:01 +01:00
@Published var theme = Theme.system
2023-01-14 08:52:51 +01:00
@Published var showInteractionStatusId = String.empty()
2022-12-30 18:20:54 +01:00
}
extension ApplicationState {
public static var preview: ApplicationState = {
let applicationState = ApplicationState()
applicationState.accountData = AccountData()
return applicationState
}()
}