SVGParserSupportedElements

public struct SVGParserSupportedElements

A struct that lists all the supported elements and attributes for a parser

  • Typealias that serves as a placeholder for a closure that returns a new SVGElement instance

    Declaration

    Swift

    public typealias ElementGenerator = () -> SVGElement
  • A dictionary of all the supported elements and attributes for a given parser.

    Declaration

    Swift

    public let tags: [String : ElementGenerator]

    Parameters

    Key

    A string that matches the SVG attribute

    Value

    A curried function to use to handle the particular attribute

  • Initializer to create your own set of supported tags

    Declaration

    Swift

    public init(tags: [String : ElementGenerator])

    Parameters

    tags

    Dictionary of SVG tag name keys and a closure values return an SVGElement

  • A configuration that will only parse <path> elements and the d and fill attributes. Use this configuration if you know you will only be parsing <path> elements with fill colors

    Declaration

    Swift

    public static var barebones: SVGParserSupportedElements { get }
  • A configuration that is the full set of elements and attributes that SwiftSVG supports. This is the default configuration for the NSXMLSVGParser.

    Declaration

    Swift

    public static var allSupportedElements: SVGParserSupportedElements { get }