InterfaceAction
public struct InterfaceAction<EventType, DestinationType, ContentType> : Equatable, Hashable where EventType : EventTypeable, DestinationType : RoutableDestinations, ContentType : ContentTypeable
Represents an action to be taken when a user interacts with a particular interface element.
-
A unique identifier.
Declaration
Swift
public let id: UUID -
A closure to be run when a user interacts with a specific user interface element.
Declaration
Swift
public var function: (EventType, InterfaceActionData<DestinationType, ContentType>) -> Void -
A user interaction type.
Declaration
Swift
public var eventType: EventType? -
Model data associated with the presentation which is used by the closure.
Declaration
Swift
public var data: InterfaceActionData<DestinationType, ContentType> -
Calls the closure.
Note
This is a “magic” function used by Swift, as part of Swift proposal SE-0253. See https://github.com/swiftlang/swift-evolution/blob/main/proposals/0253-callable.md for more information.
Declaration
Swift
public func callAsFunction() -
The initializer.
Declaration
Swift
public init(function: @escaping (EventType, InterfaceActionData<DestinationType, ContentType>) -> Void, eventType: EventType? = nil, data: InterfaceActionData<DestinationType, ContentType>? = nil)Parameters
functionA closure to be run when a user interacts with a specific user interface element.
eventTypeAn event type associated with the presentation.
dataModel data associated with the presentation which is used by the closure.
-
Declaration
Swift
public static func == (lhs: InterfaceAction, rhs: InterfaceAction) -> Bool -
Declaration
Swift
public func hash(into hasher: inout Hasher)
View on GitHub