Other Protocols

The following protocols are available globally.

  • A protocol that described an instance that can be stroked. Two default implementations are provided for this protocol:

    1. SVGShapeElement - Will set the underlying SVGLayer‘s stroke color, width, line cap, line join, and miter limit. Note that SVGLayer is a subclass ofCAShapeLayer, so this default implementation wil;l set theCAShapeLayer's line properties and not theCALayer`’s border attributes.
    2. SVGGroup - The default implementation just saves the attributes and values to be applied after all the subelements have been processed.
    See more

    Declaration

    Swift

    public protocol Strokable
  • A protocol that describes an instance that can be transformed via an SVG element’s transform attribute. Currently, matrix, rotate, scale, skewX, and skewY are supported. A default implementation is supplied for SVGContainerElements that sets the affineTransform of the container layer itself, not on all of its subelements.

    Declaration

    Swift

    public protocol Transformable
  • A protocol that describes instances whose attributes that can be set vis a css style string. A default implementation is supplied that parses the style string and applies the attributes using the SVGelement‘s supportedAttributes.

    Declaration

    Swift

    public protocol Stylable
  • A protocol describing an instance that can parse a single SVG element such as <path>, <svg>, <rect>.

    See more

    Declaration

    Swift

    public protocol SVGElement
  • A protocol that described an instance that can be filled. Two default implementations are provided for this protocol:

    1. SVGShapeElement - Will set the fill color, fill opacity, and fill rule on the underlying SVGLayer which is a subclass of CAShapeLayer
    2. SVGGroup - Will set the fill color, fill opacity, and fill rule of all of a SVGGroup‘s subelements
    See more

    Declaration

    Swift

    public protocol Fillable
  • A protocol describing an XML parser capable of parsing SVG data

    See more

    Declaration

    Swift

    public protocol SVGParser