Transformable
public protocol Transformable
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 SVGContainerElement
s that sets the affineTransform
of the container layer itself, not on all of its subelements.
-
layerToTransform
Extension methodDefault implementation for a
SVGContainerElement
that transforms thecontainerLayer
Declaration
Swift
var layerToTransform: CALayer { get }
-
layerToTransform
Extension methodDefault implementation for a
SVGShapeElement
that transforms thesvgLayer
Declaration
Swift
var layerToTransform: CALayer { get }
-
transformAttributes
Extension methodThe curried function to be used for the
SVGElement
‘s default implementation. This dictionary is meant to be used in theSVGParserSupportedElements
instanceDeclaration
Swift
var transformAttributes: [String : (String) -> ()] { get }
Parameters
Key
The SVG string value of the attribute
Value
A curried function to use to implement the SVG attribute
-
transformAttributes
Extension methodThe curried function to be used for the
SVGElement
‘s default implementation. This dictionary is meant to be used in theSVGParserSupportedElements
instanceDeclaration
Swift
var transformAttributes: [String : (String) -> ()] { get }
Parameters
Key
The SVG string value of the attribute
Value
A curried function to use to implement the SVG attribute
-
transform(_:)
Extension methodParses and applies the SVG transform string to this
SVGElement
‘sSVGLayer
. Can parse multiple transforms separated by spacesDeclaration
Swift
func transform(_ transformString: String)