Typecast

public struct Typecast

Provides methods that cast among similar value types.

  • Casts the specified rectangle instance to a CGRect.

    Declaration

    Swift

    public static func toCGRectangle(_ rect: Rect) -> CGRect

    Return Value

    A CGRect instance.

  • Undocumented

    Declaration

    Swift

    public static func toCGPoint(_ pt: Point) -> CGPoint
  • Casts the specified color instance to a CGColorRef.

    Declaration

    Swift

    public static func toCGColor(_ color: Color?) -> CGColor

    Return Value

    A CGColorRef instance.

  • Casts the specified LinearGradientBrush instance to a CGColorRef.

    Declaration

    Swift

    public static func toCGGradient(_ brush: LinearGradientBrush?) -> CGGradient

    Parameters

    rect

    The brush to cast.

    Return Value

    A CGGradientRef instance.