Siva Siva - 7 months ago 89
iOS Question

Can any one please explain what is use of CGRectZero

I am new to iOS. Can any one please explain what the use is of

and where it is used?


CFRectZero equals to CGRectMake(0,0,0,0). Usually it's used to fast-initialize CGRect object.

For example:

CGRect frame = CGRectZero;
frame.size.width = someWidth;
frame.size.height = someHeight;
myView.frame = frame;

From Apple's doc:

/* The "zero" rectangle -- equivalent to CGRectMake(0, 0, 0, 0). */ 

CG_EXTERN const CGRect CGRectZero