EncodableAction
public protocol EncodableAction : Action, Encodable
An Action
which can be encoded.
-
encode(with:
Default implementation) To enable encoding of the
Action
this helper function is needed.JSONEncoder
can’t encode anEncodable
type unless it has the specific type. By using anextension
of theAction
we have this specific type and can encode it.Default Implementation
Declaration
Swift
func encode(with encoder: JSONEncoder) -> Data?