init(_:then:else:)

Initializes an IfLetStore view that computes content depending on if a store of PresentationState and PresentationAction is nil or non-nil.

IfLetStore.swift:166
iOS
deprecated
macOS
deprecated
tvOS
deprecated
watchOS
deprecated
@preconcurrency @MainActor init<IfContent, ElseContent>(_ store: Store<PresentationState<State>, PresentationAction<Action>>, @ViewBuilder then ifContent: @escaping (_ store: Store<State, Action>) -> IfContent, @ViewBuilder else elseContent: @escaping () -> ElseContent) where Content == _ConditionalContent<IfContent, ElseContent>, IfContent : View, ElseContent : View

Parameters

store

A store of optional state.

ifContent

A function that is given a store of non-optional state and returns a view that is visible only when the optional state is non-nil.

elseContent

A view that is only visible when the optional state is nil.