Function

NSRectToCGRect(_:)

Returns a CGRect typecast from an NSRect.

Declaration

func NSRectToCGRect(_ nsrect: NSRect) -> CGRect

Return Value

A CGRect typecast from an NSRect.

See Also

Managing Rectangles

func NSContainsRect(NSRect, NSRect) -> Bool

Returns a Boolean value that indicates whether one rectangle completely encloses another.

func NSEqualRects(NSRect, NSRect) -> Bool

Returns a Boolean value that indicates whether the two rectangles are equal.

func NSIsEmptyRect(NSRect) -> Bool

Returns a Boolean value that indicates whether a given rectangle is empty.

func NSHeight(NSRect) -> CGFloat

Returns the height of a given rectangle.

func NSInsetRect(NSRect, CGFloat, CGFloat) -> NSRect

Insets a rectangle by a specified amount.

func NSIntegralRect(NSRect) -> NSRect

Adjusts the sides of a rectangle to integer values.

func NSIntegralRectWithOptions(NSRect, AlignmentOptions) -> NSRect

Adjusts the sides of a rectangle to integral values using the specified options.

func NSIntersectionRect(NSRect, NSRect) -> NSRect

Calculates the intersection of two rectangles.

func NSIntersectsRect(NSRect, NSRect) -> Bool

Returns a Boolean value that indicates whether two rectangles intersect.

func NSMakeRect(CGFloat, CGFloat, CGFloat, CGFloat) -> NSRect

Creates a new NSRect from the specified values.

func NSMaxX(NSRect) -> CGFloat

Returns the largest x coordinate of a given rectangle.

func NSMaxY(NSRect) -> CGFloat

Returns the largest y coordinate of a given rectangle.

func NSMidX(NSRect) -> CGFloat

Returns the x coordinate of a given rectangle’s midpoint.

func NSMidY(NSRect) -> CGFloat

Returns the y coordinate of a given rectangle’s midpoint.

func NSMinX(NSRect) -> CGFloat

Returns the smallest x coordinate of a given rectangle.

func NSMinY(NSRect) -> CGFloat

Returns the smallest y coordinate of a given rectangle.

func NSMouseInRect(NSPoint, NSRect, Bool) -> Bool

Returns a Boolean value that indicates whether the point is in the specified rectangle.

func NSOffsetRect(NSRect, CGFloat, CGFloat) -> NSRect

Offsets the rectangle by the specified amount.

func NSPointInRect(NSPoint, NSRect) -> Bool

Returns a Boolean value that indicates whether a given point is in a given rectangle.

func NSRectFromString(String) -> NSRect

Returns a rectangle from a text-based representation.

func NSStringFromRect(NSRect) -> String

Returns a string representation of a rectangle.

func NSRectFromCGRect(CGRect) -> NSRect

Returns an NSRect typecast from a CGRect.

func NSUnionRect(NSRect, NSRect) -> NSRect

Calculates the union of two rectangles.

func NSWidth(NSRect) -> CGFloat

Returns the width of the specified rectangle.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software