CGPoint

public extension CGPoint

Convenience functions for CGPoint.

  • Add the components of a CGPoint and a CGVector

    Declaration

    Swift

    @inlinable
    static func + (lhs: CGPoint, rhs: CGVector) -> CGPoint

    Parameters

    lhs

    the CGPoint to add

    rhs

    the CGVector to add

    Return Value

    new CGPoint representing the sum

  • Add the components of a CGPoint and a CGSize

    Declaration

    Swift

    @inlinable
    static func + (lhs: CGPoint, rhs: CGSize) -> CGPoint

    Parameters

    lhs

    the CGPoint to add

    rhs

    the CGSize to add

    Return Value

    new CGPoint representing the sum

  • Subtract the components of a CGPoint and a CGVector

    Declaration

    Swift

    @inlinable
    static func - (lhs: CGPoint, rhs: CGVector) -> CGPoint

    Parameters

    lhs

    the CGPoint to subtract

    rhs

    the CGVector to subtract

    Return Value

    new CGPoint representing the difference

  • Subtract the components of two CGPoint values

    Declaration

    Swift

    @inlinable
    static func - (lhs: CGPoint, rhs: CGPoint) -> CGVector

    Parameters

    lhs

    the CGPoint to subtract

    rhs

    the CGPoint to subtract

    Return Value

    new CGVector representing the difference