MultiDecoder
public class MultiDecoder<ResultType>
Simple pattern for trying to decode array elements as multiple types.
-
Adds the decoded result to
resultsif decoding succeeds. If decoding fails because the shape type doesn’t match, do nothing. Throws all other errors.Another way to put it is that this method catches
DrawsanaDecodingError.wrongShapeTypeErrorandSwift.DecodingError.valueNotFound.Declaration
Swift
public func decode<T>(_ type: T.Type) throws where T : Shape
View on GitHub
MultiDecoder Class Reference