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)
A CGRect just looks like this:
struct CGRect {
CGPoint origin;
CGSize size;
};
typedef struct CGRect CGRect;
And CGPoint and CGSize just 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 feel like creating your own CGRectMake, feel free to do so:
CG_INLINE CGRect
MyPrivateCGRectMake(CGPoint p, CGSize s)
{
CGRect rect;
rect.origin = p;
rect.size = s;
return rect;
}
But there is no way you can change which arguments an already existing function accepts.