init(_:action:then:fileID:filePath:line:column:)

Initializes a CaseLet view that computes content depending on if a store of enum state matches a particular case.

SwitchStore.swift:144
iOS
deprecated
macOS
deprecated
tvOS
deprecated
watchOS
deprecated
@MainActor init(_ toCaseState: @escaping (EnumState) -> CaseState?, action fromCaseAction: @escaping (CaseAction) -> EnumAction, @ViewBuilder then content: @escaping (_ store: Store<CaseState, CaseAction>) -> Content, fileID: StaticString = #fileID, filePath: StaticString = #filePath, line: UInt = #line, column: UInt = #column)

Parameters

toCaseState

A function that can extract a case of switch store state, which can be specified using case path literal syntax, e.g. /State.case.

fromCaseAction

A function that can embed a case action in a switch store action.

content

A function that is given a store of the given case’s state and returns a view that is visible only when the switch store’s state matches.

fileID

The fileID.

filePath

The filePath.

line

The line.

column

The column.