CGRectMake
Returns a rectangle with the specified coordinate and size values.
Declaration
SWIFT
func CGRectMake(_ x: CGFloat,
_ y: CGFloat,
_ width: CGFloat,
_ height: CGFloat) -> CGRect
OBJECTIVE-C
CGRect CGRectMake ( CGFloat x, CGFloat y, CGFloat width, CGFloat height );
Parameters
x
The x-coordinate of the rectangle’s origin point.
y
The y-coordinate of the rectangle’s origin point.
width
The width of the rectangle.
height
The height of the rectangle.
Return Value
A rectangle with the specified location and dimensions.
Import Statement
OBJECTIVE-C
@import CoreGraphics;
SWIFT
import CoreGraphics
coordinate坐标的意思;rectangle矩形的意思;
CGSizeMake
Returns a size with the specified dimension values.
Declaration
SWIFT
func CGSizeMake(_ width: CGFloat,
_ height: CGFloat) -> CGSize
OBJECTIVE-C
CGSize CGSizeMake ( CGFloat width, CGFloat height );
Parameters
width
A width value.
height
A height value.
Return Value
Returns a CGSize structure with the specified width and height.
Import Statement
OBJECTIVE-C
@import CoreGraphics;
SWIFT
import CoreGraphics