37 lines
778 B
Swift
37 lines
778 B
Swift
import Foundation
|
|
|
|
enum AppFlow: Codable {
|
|
case start
|
|
case accounts
|
|
case chats
|
|
case contacts
|
|
case settings
|
|
}
|
|
|
|
struct AppState: Stateable {
|
|
var appVersion: String
|
|
var previousFlow: AppFlow
|
|
var currentFlow: AppFlow
|
|
|
|
var startState: StartState
|
|
var accountsState: AccountsState
|
|
var rostersState: RostersState
|
|
var chatsState: ChatsState
|
|
var conversationsState: ConversationState
|
|
}
|
|
|
|
// MARK: Init
|
|
extension AppState {
|
|
init() {
|
|
appVersion = Const.appVersion
|
|
previousFlow = .start
|
|
currentFlow = .start
|
|
|
|
startState = StartState()
|
|
accountsState = AccountsState()
|
|
rostersState = RostersState()
|
|
chatsState = ChatsState()
|
|
conversationsState = ConversationState()
|
|
}
|
|
}
|