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:
SVGShapeElement
- Will set the underlyingSVGLayer
‘s stroke color, width, line cap, line join, and miter limit. Note thatSVGLayer is a subclass of
CAShapeLayer, so this default implementation wil;l set the
CAShapeLayer's line properties and not the
CALayer`’s border attributes.SVGGroup
- The default implementation just saves the attributes and values to be applied after all the subelements have been processed.
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
, andskewY
are supported. A default implementation is supplied forSVGContainerElement
s that sets theaffineTransform
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
‘ssupportedAttributes
.Declaration
Swift
public protocol Stylable
-
A protocol describing an instance that can parse a single SVG element such as
See more<path>, <svg>, <rect>
.Declaration
Swift
public protocol SVGElement
-
A protocol that describes an instance that can store SVG sublayers and can apply a single attributes to all sublayers.
See moreDeclaration
Swift
public protocol SVGContainerElement: SVGElement, Fillable, Strokable, Transformable, Stylable
-
A protocol that described an instance that can be filled. Two default implementations are provided for this protocol:
SVGShapeElement
- Will set the fill color, fill opacity, and fill rule on the underlyingSVGLayer
which is a subclass ofCAShapeLayer
SVGGroup
- Will set the fill color, fill opacity, and fill rule of all of aSVGGroup
‘s subelements
Declaration
Swift
public protocol Fillable
-
A protocol describing an XML parser capable of parsing SVG data
See moreDeclaration
Swift
public protocol SVGParser
-
A protocol that describes an instance that stores the path as a
See moreCAShapeLayer
Declaration
Swift
public protocol SVGShapeElement: SVGElement, Fillable, Strokable, Transformable, Stylable