Dev:UIView

UIView is a relatively light wrapper around CALayer. It is the root class of all elements displayed on the screen.

Getting View Hierarchy Info
There are two ways of getting the view hierarchy info, the "human readable" -[UIView recursiveDescription] and "machine readable" -[UIView scriptingInfoWithChildren].

-recursiveDescription
Returns the description of the view and its subviews.

Example output:

> > > >

-scriptingInfoWithChildren
This function returns an NSDictionary with contains some information e.g. geometry, class name, etc.

Animation Blocks
Animation blocks are implemented by the UIViewAnimationState class with the following correspondences: In above, __currentViewAnimationState is a global variable, which is a UIViewAnimationState. This value is automatically updated after calling +pushViewAnimationState:context: and +popAnimationState. NULL checks were omitted in the above codes for simplicity.

There are also a few undocumented methods:

There are also a few equivalent (probably deprecated) selectors:

frame and bounds
frame and bounds</tt> are both properties of a UIView. When the view's transform</tt> is not identity, the only difference between them is the origin of bounds</tt> is always zero.

When transform</tt> is not identity, the SDK documentation warns that frame</tt> is undefined: Warning: If the transform</tt> property is not the identity transform, the value of this property is undefined and therefore should be ignored. However, this is not completely true — the frame</tt> is actually the rectangle enclosing the transformed view.

These properties are actually proxies to the corresponding ones of CALayer. However, while the bounds</tt> (and center</tt>) is an internal property, frame</tt> incurs a transactional lock (spin lock) and an affine transform.