StandardAction
public struct StandardAction: Action
This is Swift Flow’s built in action type, it is the only built in type that conforms to the
Action
protocol. StandardAction
can be serialized and can therefore be used with developer tools
that restore state between app launches.
The downside of StandardAction
is that it carries its payload as an untyped dictionary which does
not play well with Swift’s type system.
It is recommended that you define your own types that conform to Action
- if you want to be able
to serialize your custom action types, you can implement StandardActionConvertible
which will
make it possible to generate a StanardAction
from your typed action - the best of both worlds!
-
A String that identifies the type of this
StandardAction
Declaration
Swift
public let type: String
-
An untyped, JSON-compatible payload
Declaration
Swift
public let payload: [String: AnyObject]?
-
Indicates whether this action will be deserialized as a typed action or as a standard action
Declaration
Swift
public let isTypedAction: Bool
-
Initializes this
StandardAction
with only a type. The payload will be nil andisTypedAction
will be set to false.Declaration
Swift
public init(_ type: String)
-
Initializes this
StandardAction
with a type, a payload and information about whether this is a typed action or not.Declaration
Swift
public init(type: String, payload: [String: AnyObject]?, isTypedAction: Bool = false)
-
Undocumented
Declaration
Swift
public struct StandardAction: Action
-
Undocumented
Declaration
Swift
public struct StandardAction: Action