The Foundation framework includes numerous functions for manipulating geometric values and for performing various calculations using those values. In addition to basic equality checks, you can perform more complex operations, such as the union and intersection of rectangles or the inclusion of a point in a rectangle’s boundaries.
Table 5-3 lists some of the more commonly used functions and their behaviors. The function syntax is provided in a shorthand notation, with parameter types omitted to demonstrate the calling convention. For a complete list of available functions, and their full syntax, see the Functions section in Foundation Framework Reference.
Operation |
Function |
Description |
|---|---|---|
Creation |
Returns a properly formatted |
|
Returns a properly formatted |
||
Returns a properly formatted |
||
Equality |
Returns |
|
Returns |
||
Returns |
||
Rectangle manipulations |
Returns |
|
Returns a copy of the specified rectangle with its sides moved inward by the specified delta values. Negative delta values move the sides outward. Does not modify the original rectangle. |
||
Returns the intersection of the two rectangles. |
||
|
Returns the union of the two rectangles. |
|
Tests whether the point lies within the specified view rectangle. Adjusts the hit-detection algorithm to provide consistent behavior from the user’s perspective. |
||
Tests whether the point lies within the specified rectangle. This is a basic mathematical comparison. |
Last updated: 2007-10-31