CGRectMake (1, 3, size):
CGRectMake(1, 3, size.width, size.heigh)
CGRectMake (pointB, size):
CGRectMake(pointB.x, pointB.y, size.width, size.height)
CGRectMake (pointB, size.width, size.height):
CGRectMake(pointB.x, pointB.y, size.width, size.height)
CGRect looks something like this:
struct CGRect { CGPoint origin; CGSize size; }; typedef struct CGRect CGRect;
Both CGPoint and CGSize look like this:
struct CGPoint { CGFloat x; CGFloat y; }; typedef struct CGPoint CGPoint; struct CGSize { CGFloat width; CGFloat height; }; typedef struct CGSize CGSize;
CGRectMake is the following function:
CG_INLINE CGRect CGRectMake(CGFloat x, CGFloat y, CGFloat width, CGFloat height) { CGRect rect; rect.origin.x = x; rect.origin.y = y; rect.size.width = width; rect.size.height = height; return rect; }
So, instead of:
CGRect r = CGRectMake(pointB.x, pointB.y, size.width, size.height)
You can simply write:
CGRect r; r.origin = pointB; r.size = size;
If you want to create your own CGRectMake, feel free to:
CG_INLINE CGRect MyPrivateCGRectMake(CGPoint p, CGSize s) { CGRect rect; rect.origin = p; rect.size = s; return rect; }
But you cannot change what arguments an existing function takes.