init(_:content:)
SwitchStore.swift:80- iOS
- deprecated
- macOS
- deprecated
- tvOS
- deprecated
- watchOS
- deprecated
@MainActor init(_ store: Store<State, Action>, @ViewBuilder content: @escaping (_ initialState: State) -> Content)
@MainActor init(_ store: Store<State, Action>, @ViewBuilder content: @escaping (_ initialState: State) -> Content)
s22ComposableArchitecture11SwitchStoreV_7contentACyxq_q0_GAA0D0Cyxq_G_q0_xctcfc
What are these?6RCXF
import ComposableArchitecture
The Composable Architecture (TCA, for short) is a library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind. It can be used in SwiftUI, UIKit, and more, and on any Apple platform (iOS, macOS, tvOS, and watchOS).
@MainActor struct SwitchStore<State, Action, Content> where Content : View
A view that observes when enum state held in a store changes cases, and provides stores to CaseLet
views.
@globalActor final actor MainActor
A singleton actor whose executor is equivalent to the main dispatch queue.
@dynamicMemberLookup @preconcurrency @MainActor final class Store<State, Action>
A store represents the runtime that powers the application. It is the object that you will pass around to views that need to interact with the application.
@MainActor var body: some View { get }
@MainActor let content: (State) -> Content
@MainActor let store: Store<State, Action>