DestinationInterfacing
@MainActor
public protocol DestinationInterfacing<PresentationConfiguration>
A protocol representing a user interface object that is handled by Destinations. This is typically a View
in SwiftUI or a UIViewController
in UIKit.
-
An enum which defines types of Interactors. Each Destination may have its own Interactor types.
Declaration
Swift
associatedtype InteractorType : InteractorTypeable
-
An enum which defines user interaction types for this Destination’s interface.
Declaration
Swift
associatedtype UserInteractionType : UserInteractionTypeable
-
A model type which configures Destination presentations, used to present Destinations from user interactions with this interface. Typically this is a
DestinationPresentation
.Declaration
Swift
associatedtype PresentationConfiguration where Self.PresentationConfiguration == Self.Destination.PresentationConfiguration
-
The type of Destination associated with this user interface.
Declaration
Swift
associatedtype Destination where Self.Destination == Self.DestinationState.Destination
-
The state model associated with this interface’s Destination.
Declaration
Swift
associatedtype DestinationState : DestinationStateable
-
The Destination associated with this UI element.
Declaration
Swift
@MainActor var destinationState: DestinationState { get set }
-
destination()
Default implementationReturns the current Destination associated with this interface element.
Default Implementation
Declaration
Swift
@MainActor func destination() -> Destination
Return Value
The associated Destination.
-
cleanupResources()
Default implementationWhen this method is called, this interface’s Destination is about to be removed from the Flow. Any resource references should be removed and in-progress tasks should be stopped.
Default Implementation
Declaration
Swift
@MainActor func cleanupResources()