I use integers all the time in these two commands. It works fine and I suspect it’s common to do this.
But technically, I believe they require CG Floats, not integers.
Why does it work, and it is wrong to do this? If so, how to easily convert an int into a cg float ?
Yes an
intcan be implicitly converted to afloat(i.e.CGFloat). Which means that, if you callCGSizeMake(40, 50), the C compiler can recognize that afloatis required and convert the generated code toCGSizeMake(40.0f, 50.0f)automatically.