Structures

The following structures are available globally.

  • Undocumented

    See more

    Declaration

    Swift

    public struct Encoding : Hashable
  • Undocumented

    See more

    Declaration

    Swift

    public struct Font : Hashable
  • An affine transformation matrix is used to rotate, scale, translate, or skew the objects you draw in a graphics context. The AffineTransform type provides functions for creating, concatenating, and applying affine transformations.

    Affine transforms are represented by a 3 by 3 matrix:

    / a  b  0 \
    | c  d  0 |
    \ tx ty 1 /
    

    Because the third column is always (0,0,1), the AffineTransform structure contains values for only the first two columns.

    Conceptually, an affine transform multiplies a row vector representing each point (x,y) in your drawing by this matrix, producing a vector that represents the corresponding point (x’,y’):

                          / a  b  0 \
    (x y 1) = (x y 1) × | c  d  0 |
                          \ tx ty 1 /
    

    Given the 3 by 3 matrix, the following equations are used to transform a point (x, y) in one coordinate system into a resultant point (x’,y’) in another coordinate system.

    x = a * x + c * y + tx
    y = b * x + d * y + ty
    

    The matrix thereby “links” two coordinate systems — it specifies how points in one coordinate system map to points in another.

    Note that you do not typically need to create affine transforms directly. If you want only to draw an object that is scaled or rotated, for example, it is not necessary to construct an affine transform to do so. The most direct way to manipulate your drawing — whether by movement, scaling, or rotation — is to call the functions translateBy(x:y:), scaleBy(x:y:), or rotate(by:), respectively.

    See more

    Declaration

    Swift

    public struct AffineTransform : Hashable
  • Dash pattern for lines in a page.

    See more

    Declaration

    Swift

    public struct DashStyle : Hashable
  • A structure that contains width and height values.

    See more

    Declaration

    Swift

    public struct Size : Hashable
  • A structure that contains a point in a two-dimensional coordinate system.

    See more

    Declaration

    Swift

    public struct Point : Hashable
  • A structure that contains a two-dimensional vector.

    See more

    Declaration

    Swift

    public struct Vector : Hashable
  • A structure that contains the location and dimensions of a rectangle.

    See more

    Declaration

    Swift

    public struct Rectangle : Hashable
  • A type for graphics paths: mathematical descriptions of shapes or lines to be drawn in a DrawingContext.

    See more

    Declaration

    Swift

    public struct Path : Hashable
  • Represents a grid that can be drawn on a PDF page.

    See more

    Declaration

    Swift

    public struct Grid : Equatable
  • Undocumented

    See more

    Declaration

    Swift

    public struct PDFError : Error, Hashable