AppState

class AppState : ObservableObject

The class to observe the Kodio App state

  • The shared instance of this AppState class

    Declaration

    Swift

    static let shared: AppState
  • The Kodio settings

    Declaration

    Swift

    @Published
    var settings: KodioSettings { get set }
  • The current selection in the sidebar

    Declaration

    Swift

    @Published
    var selection: Router { get set }
  • The current search query

    Declaration

    Swift

    var query: String
  • Init the class; get Kodio settings

    Declaration

    Swift

    private init()
  • updateSearch(query:) Asynchronous

    Update the search query

    Declaration

    Swift

    @MainActor
    func updateSearch(query: String) async

    Parameters

    query

    The search query

  • Update the Kodio settings

    Declaration

    Swift

    @MainActor
    func updateSettings(settings: KodioSettings)

    Parameters

    settings
  • The state of loading a View

    Note

    This enum is not used in this class but in Views that load items via a Task
    See more

    Declaration

    Swift

    enum State