diff --git a/modules/react-native-ui-text-view/ios/RNUITextView.swift b/modules/react-native-ui-text-view/ios/RNUITextView.swift index d51ee4e5..3fb55873 100644 --- a/modules/react-native-ui-text-view/ios/RNUITextView.swift +++ b/modules/react-native-ui-text-view/ios/RNUITextView.swift @@ -108,7 +108,7 @@ class RNUITextView: UIView { fractionOfDistanceBetweenInsertionPoints: nil ) - var lastUpperOffset: Int = 0 + var lastUpperBound: String.Index? = nil for child in self.reactSubviews() { if let child = child as? RNUITextViewChild, let childText = child.text { let fullText = self.textView.attributedText.string @@ -116,8 +116,7 @@ class RNUITextView: UIView { // We want to skip over the children we have already checked, otherwise we could run into // collisions of similar strings (i.e. links that get shortened to the same hostname but // different paths) - let startIndex = fullText.index(fullText.startIndex, offsetBy: lastUpperOffset) - let range = fullText.range(of: childText, options: [], range: startIndex..