Class

UIRegion

A shape for use in UIKit Dynamics.

Declaration

@interface UIRegion : NSObject

Overview

When creating animations, you use regions to define the effective area of a field behavior such as a magnetic or gravitational force. Most regions are rectangular or elliptical in shape, but you can use the methods of this class to create more complex shapes by adding, subtracting, and intersecting other regions.

When creating a new region, you specify only the size of the corresponding rectangle or circle. The origin of a newly created region is at the center of the specified area, and any mathematical manipulations you make to the region occur relative to that origin point.

Topics

Creating and Initializing Regions

infiniteRegion

Returns the region that encloses all points.

- initWithSize:

Initializes and returns a rectangular region of the specified size.

- initWithRadius:

Initializes and returns a region with a circular shape of the specified radius.

Creating Complex Regions

- inverseRegion

Returns a new region that is the mathematical inverse of the current region.

- regionByDifferenceFromRegion:

Returns a new region created by subtracting the specified region from the current region.

- regionByIntersectionWithRegion:

Returns a new region containing only the area occupied by both the specified region and current region.

- regionByUnionWithRegion:

Returns a new region containing the combined areas of the specified region and the current region.

Interacting with a Region

- containsPoint:

Returns a Boolean indicating whether the specified point is inside of the current region.

Relationships

Inherits From

Conforms To