Siva Siva - 1 year ago 155
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?

Answer Source

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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download