Contents

toSize()

Converts the value to a size.

Declaration

func toSize() -> CGSize

Return Value

A CoreGraphics size representation of the value.

Discussion

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

See Also

Reading and Converting JavaScript Values