Cgfloat is double cgpoint and nspoint, but cgpoint is generally used in development, because cgpoint is cross-platform
Cgpoint and nspoint indicate a point.
The most common method is cgpointmake (x, y)
Cgpoint p1 = cgpointmake (x, y );
Nspoint p1 = cgpointmake (x, y ); You can also use cgpoint P = nsmakepoint (x, y); nspoint P = nsmakepoint (x, y );
Nssize is equivalent to cgsize. There are two parameters, one being long and the other being wide, indicating that the UI element size is created using nsmakesize (W, h) cgsizemake (W, H) nssize S1 = cgsizemake (100,100); nssize S2 = nsmakesize (100,100); cgsize S3 = nsmakesize (100,100 );
Nsrect is equivalent to cgrect. It indicates that the location and size have two parameters: (cgpoint, cgsize) cgpoint corresponds to the origin cgsize parameter size cgrect R1 = cgrectmake (,); other methods to create cgrect: cgrect r = {}, {}}; cgrect r = {p1, p2 };
Converts a struct to a string.
Nsstringfromrange (<# nsange range #>) converts nspoint or cgpoint to a string: nsstringfrompoint (<# nspoint apoint #>) to convert nssize or cgsize to a string: nsstringfromsize (<# nssize asize #>) converts nsrect or cgrect to a string: nsstringfromrect (<# nsrect arect #>) origin: cgpointmake (0, 0) is equivalent
Cgpointzero
Cgpointzero is a constant that represents the coordinate origin. Cgsizezero is equivalent to cgsizemake (0, 0 );
Cgsizezero is a constant, representing the size of 0 Cgrectzero is equivalent to cgrectmake (0, 0, 0, 0 );
Cgrectzero is a constant that represents the UI element with a size of 0 at the coordinate origin. Compare whether the two points are the same:
Cgpointequaltopoint (point1, point2 ); The return value is bool to compare whether the two dimensions are the same:
Cgsizeeuqaltosize (size1, size2 ); The returned value is whether the bool comparison position and size are the same:
Cgrectequaltorect (rect1, rect2 ); The return value is bool to determine whether a rectangle contains a vertex:
Cgrectcontainspoint (rect, point ); The returned value is the coordinate origin in bool iOS, which is in the upper left corner:
Foundation-02 _ struct _ point, size, rect