Contents

toRange()

Converts the value to a range.

Declaration

func toRange() -> NSRange

Return Value

A range representation of the value.

Discussion

This method treats the value as a JavaScript object, reading the values of its location and length properties using the toDouble() method and creating a NSRange structure from the result. If the value is not a JavaScript object or does not have the appropriate properties, the resulting range is invalid.

See Also

Reading and Converting JavaScript Values