NSRange
public extension NSRange
-
Range with 0 location and length
Declaration
Swift
static var zero: NSRange { get } -
Undocumented
Declaration
Swift
var firstCharacterRange: NSRange { get } -
Undocumented
Declaration
Swift
var lastCharacterRange: NSRange { get } -
Undocumented
Declaration
Swift
var previousPosition: NSRange { get } -
Undocumented
Declaration
Swift
var nextPosition: NSRange { get } -
Undocumented
Declaration
Swift
var endLocation: Int { get } -
Undocumented
Declaration
Swift
var nextCharacterRange: NSRange { get } -
Undocumented
Declaration
Swift
var previousCharacterRange: NSRange? { get } -
Converts the range to
UITextRangein givenUITextInput. Returns nil if the range is invalid in theUITextInput.Declaration
Swift
func toTextRange(textInput: UITextInput) -> UITextRange?Parameters
textInputUITextInput to convert the range in.
-
Checks if the range is valid in given
UITextInputDeclaration
Swift
func isValidIn(_ textInput: UITextInput) -> BoolParameters
textInputUITextInput to validate the range in.
-
Shifts the range with given shift value
Important
The shifted range may or may not be valid in a given string. Validity of shifted range must always be checked at the usage site.Declaration
Swift
func shiftedBy(_ shift: Int) -> NSRangeParameters
shiftInt value to shift range by.
Return Value
Shifted range with same length.
View on GitHub
NSRange Extension Reference