Contents

toRect()

Converts the value to a rectangle structure.

Declaration

func toRect() -> CGRect

Return Value

A CoreGraphics point representation of the value.

Discussion

This method treats the value as a JavaScript object, reading the values of its x, y, width, and height properties using the toDouble() method and creating a CGRect structure from the result. If the value is not a JavaScript object or does not have the appropriate properties, each of the resulting rectangle’s coordinates is not a number (NaN).

See Also

Reading and Converting JavaScript Values