diff --git a/Tusker/Screens/Compose/ComposeContentWarningTextField.swift b/Tusker/Screens/Compose/ComposeContentWarningTextField.swift index 6148e3e3ad..72cf26aa12 100644 --- a/Tusker/Screens/Compose/ComposeContentWarningTextField.swift +++ b/Tusker/Screens/Compose/ComposeContentWarningTextField.swift @@ -70,11 +70,17 @@ struct ComposeContentWarningTextField: UIViewRepresentable { return } + let distanceToEnd = textField.offset(from: selectedRange.start, to: textField.endOfDocument) + let selectedRangeStartUTF16 = textField.offset(from: textField.beginningOfDocument, to: selectedRange.start) let characterBeforeCursorIndex = text.utf16.index(text.startIndex, offsetBy: selectedRangeStartUTF16) textField.text!.replaceSubrange(lastWordStartIndex..