location(_:offsetBy:)
Returns a new location from location with offset you provide.
Declaration
optional func location(_ location: any NSTextLocation, offsetBy offset: Int) -> (any NSTextLocation)?Parameters
- location:
An Nstextlocation in the text element.
- offset:
An offset of the number of characters to or from
location.
Return Value
An new NSTextLocation, or nil of the offset exceeds the bounds of the text.