Contents

offset(from:to:)

Returns the number of UTF-16 characters between one text position and another text position.

Declaration

func offset(from: UITextPosition, to toPosition: UITextPosition) -> Int

Parameters

  • from:

    A custom object that represents a location within a document.

  • toPosition:

    A custom object that represents another location within document.

Return Value

The number of UTF-16 characters between fromPosition and toPosition.

See Also

Evaluating text positions