CATransform3D

extension CATransform3D: Equatable
extension CATransform3D: Codable
  • Returns a Boolean value indicating whether two values are equal.

    Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

    Declaration

    Swift

    @inlinable
    public static func == (lhs: CATransform3D, rhs: CATransform3D) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.

Static Properties

  • SwifterSwift: The identity transform: [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1].

    Declaration

    Swift

    @inlinable
    static var identity: CATransform3D { get }

Codable

  • Creates a new instance by decoding from the given decoder.

    This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

    Declaration

    Swift

    @inlinable
    public init(from decoder: Decoder) throws

    Parameters

    decoder

    The decoder to read data from.

  • Encodes this value into the given encoder.

    If the value fails to encode anything, encoder will encode an empty keyed container in its place.

    This function throws an error if any values are invalid for the given encoder’s format.

    Declaration

    Swift

    @inlinable
    public func encode(to encoder: Encoder) throws

    Parameters

    encoder

    The encoder to write data to.

Initializers

  • SwifterSwift: Returns a transform that translates by (tx, ty, tz).

    Declaration

    Swift

    @inlinable
    init(translationX tx: CGFloat, y ty: CGFloat, z tz: CGFloat)

    Parameters

    tx

    x-axis translation

    ty

    y-axis translation

    tz

    z-axis translation

  • SwifterSwift: Returns a transform that scales by (sx, sy, sz).

    Declaration

    Swift

    @inlinable
    init(scaleX sx: CGFloat, y sy: CGFloat, z sz: CGFloat)

    Parameters

    sx

    x-axis scale

    sy

    y-axis scale

    sz

    z-axis scale

  • SwifterSwift: Returns a transform that rotates by angle radians about the vector (x, y, z).

    If the vector has zero length the behavior is undefined.

    Declaration

    Swift

    @inlinable
    init(rotationAngle angle: CGFloat, x: CGFloat, y: CGFloat, z: CGFloat)

    Parameters

    angle

    The angle of rotation

    x

    x position of the vector

    y

    y position of the vector

    z

    z position of the vector

Properties

  • SwifterSwift: Returns true if the receiver is the identity transform.

    Declaration

    Swift

    @inlinable
    var isIdentity: Bool { get }

Methods

  • SwifterSwift: Translate the receiver by (tx, ty, tz).

    Declaration

    Swift

    @inlinable
    func translatedBy(x tx: CGFloat, y ty: CGFloat, z tz: CGFloat) -> CATransform3D

    Parameters

    tx

    x-axis translation

    ty

    y-axis translation

    tz

    z-axis translation

    Return Value

    The translated matrix.

  • SwifterSwift: Scale the receiver by (sx, sy, sz).

    Declaration

    Swift

    @inlinable
    func scaledBy(x sx: CGFloat, y sy: CGFloat, z sz: CGFloat) -> CATransform3D

    Parameters

    sx

    x-axis scale

    sy

    y-axis scale

    sz

    z-axis scale

    Return Value

    The scaled matrix.

  • SwifterSwift: Rotate the receiver by angle radians about the vector (x, y, z).

    If the vector has zero length the behavior is undefined.

    Declaration

    Swift

    @inlinable
    func rotated(by angle: CGFloat, x: CGFloat, y: CGFloat, z: CGFloat) -> CATransform3D

    Parameters

    angle

    The angle of rotation

    x

    x position of the vector

    y

    y position of the vector

    z

    z position of the vector

    Return Value

    The rotated matrix.

  • SwifterSwift: Invert the receiver.

    Returns the original matrix if the receiver has no inverse.

    Declaration

    Swift

    @inlinable
    func inverted() -> CATransform3D

    Return Value

    The inverted matrix of the receiver.

  • SwifterSwift: Concatenate transform to the receiver.

    Declaration

    Swift

    @inlinable
    func concatenating(_ t2: CATransform3D) -> CATransform3D

    Parameters

    t2

    The transform to concatenate on to the receiver

    Return Value

    The concatenated matrix.

  • SwifterSwift: Translate the receiver by (tx, ty, tz).

    Declaration

    Swift

    @inlinable
    mutating mutating func translateBy(x tx: CGFloat, y ty: CGFloat, z tz: CGFloat)

    Parameters

    tx

    x-axis translation

    ty

    y-axis translation

    tz

    z-axis translation

  • SwifterSwift: Scale the receiver by (sx, sy, sz).

    Declaration

    Swift

    @inlinable
    mutating mutating func scaleBy(x sx: CGFloat, y sy: CGFloat, z sz: CGFloat)

    Parameters

    sx

    x-axis scale

    sy

    y-axis scale

    sz

    z-axis scale

  • SwifterSwift: Rotate the receiver by angle radians about the vector (x, y, z).

    If the vector has zero length the behavior is undefined.

    Declaration

    Swift

    @inlinable
    mutating mutating func rotate(by angle: CGFloat, x: CGFloat, y: CGFloat, z: CGFloat)

    Parameters

    angle

    The angle of rotation

    x

    x position of the vector

    y

    y position of the vector

    z

    z position of the vector

  • SwifterSwift: Invert the receiver.

    Returns the original matrix if the receiver has no inverse.

    Declaration

    Swift

    @inlinable
    mutating mutating func invert()
  • SwifterSwift: Concatenate transform to the receiver.

    Declaration

    Swift

    @inlinable
    mutating mutating func concatenate(_ t2: CATransform3D)

    Parameters

    t2

    The transform to concatenate on to the receiver

CGAffineTransform

  • SwifterSwift: Returns true if the receiver can be represented exactly by an affine transform.

    Declaration

    Swift

    @inlinable
    var isAffine: Bool { get }
  • SwifterSwift: Returns the affine transform represented by the receiver.

    If the receiver can not be represented exactly by an affine transform the returned value is undefined.

    Declaration

    Swift

    @inlinable
    func affineTransform() -> CGAffineTransform