We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We can currently use the context to select a range, but not replace the currently selected text.
This should be possible when replacing text.
Replace the pasteText function with an insertText(at: position) (non-replacing) and insertText(at: range) (replacing).
pasteText
insertText(at: position)
insertText(at: range)
The text was updated successfully, but these errors were encountered:
Thank you again for your truly impressive library. What a gift!
It appears to already be possible (early Aug '23) to replace text at a specific offset:
context.pasteText("<some text>", at: <some offset>, moveCursorToPastedContent: T/F)
But yes, a range would definitely be more usable. However, the solution should support styled text (ie, NSAttributedString) as well. For example:
let attr = [NSAttributedString.Key.foregroundColor: UIColor.lightGray, NSAttributedString.Key.font: UIFont.systemFont(ofSize: 24] let text = NSMutableAttributedString(string: "<some text here>\n", attributes: attr) <magic>.replaceText(in: context.selectedRange, with: text)
FWIW, pasteText() does not appear to accommodate styled text.
Sorry, something went wrong.
Hi @savanteer
Thanks for your feedback! I hope to have time to work on this in a few weeks.
No branches or pull requests
We can currently use the context to select a range, but not replace the currently selected text.
This should be possible when replacing text.
Replace the
pasteText
function with aninsertText(at: position)
(non-replacing) andinsertText(at: range)
(replacing).The text was updated successfully, but these errors were encountered: