Constructor
public final class Constructor
Constructors are used to translate Nodes to Swift values.
-
Maps
Tag.Names toNode.Scalars. -
Maps
Tag.Names toNode.Mappings. -
Maps
Tag.Names toNode.Sequences. -
Initialize a
Constructorwith the specified maps, falling back to default maps.Declaration
Swift
public init(_ scalarMap: ScalarMap = defaultScalarMap, _ mappingMap: MappingMap = defaultMappingMap, _ sequenceMap: SequenceMap = defaultSequenceMap)Parameters
scalarMapMaps
Tag.Names toNode.Scalars.mappingMapMaps
Tag.Names toNode.Mappings.sequenceMapMaps
Tag.Names toNode.Sequences. -
Constructs Swift values based on the maps this
Constructorwas initialized with.Declaration
Swift
public func any(from node: Node) -> AnyParameters
nodeNodefrom which to extract anAnySwift value, if one was produced by the Node type’s relevant mapping on thisConstructor.Return Value
An
AnySwift value, if one was produced by the Node type’s relevant mapping on thisConstructor.
-
The default
Constructorto be used with APIs where none is explicitly provided.Declaration
Swift
public static var `default`: Constructor { get } -
The default
Tag.NametoNode.Scalarmap.Declaration
Swift
public static var defaultScalarMap: ScalarMap { get } -
The default
Tag.NametoNode.Mappingmap.Declaration
Swift
public static var defaultMappingMap: MappingMap { get } -
The default
Tag.NametoNode.Sequencemap.Declaration
Swift
public static var defaultSequenceMap: SequenceMap { get } -
Tag.NametoNode.Mappingmap that supportNSMutableDictionaryandNSMutableSet.Declaration
Swift
public static var nsMutableMappingMap: MappingMap { get } -
Tag.NametoNode.Sequencemap that supportNSMutableArray.Declaration
Swift
public static var nsMutableSequenceMap: SequenceMap { get }
View on GitHub
Install in Dash