Describe the bug
When using an autocomplete prefix starting with a forward slash like "/name", I get an index out-of-bounds error at line 180 in AutoCompletemanager
let wordWithoutPrefix = (result.word as NSString).substring(from: result.prefix.utf16.count)
When checking the error, the word registered in the autocomplete is picking up as e, its almost as if the index is out by one due to the forward slash being used and the result returned is showing e as a word following the prefix.
To Reproduce
Steps/code to reproduce the behavior:
Register a new autocomplete prefix like so autocompleteManager.register(prefix: "/name") in the example app and try and use the prefix in the input bar, it will throw an error.
Expected behavior
I am under the assumption I should be able to use /name as a prefix similar to how Slack uses forward slash commands and then select from the results returned.
Environment
InputBarAccessoryView version 5.5.0
iOS 16.2
Swift 5
Tested on iPhone 13 Pro max
You should be able to reproduce the issue in the example app.
Additional context
Add any other context about the problem here.
Describe the bug When using an autocomplete prefix starting with a forward slash like
"/name"
, I get an index out-of-bounds error at line 180 in AutoCompletemanagerlet wordWithoutPrefix = (result.word as NSString).substring(from: result.prefix.utf16.count)
When checking the error, the word registered in the autocomplete is picking up as
e
, its almost as if the index is out by one due to the forward slash being used and the result returned is showinge
as a word following the prefix.To Reproduce Steps/code to reproduce the behavior: Register a new autocomplete prefix like so
autocompleteManager.register(prefix: "/name")
in the example app and try and use the prefix in the input bar, it will throw an error.Expected behavior I am under the assumption I should be able to use
/name
as a prefix similar to how Slack uses forward slash commands and then select from the results returned.Environment
Additional context Add any other context about the problem here.