I want to make the following behavior possible in SwiftUI but i dont know how:
Imagine having a Text that contains a string (or attributed string), also you have a pointer that can be hovered over the letters of the string like a mouse icon (or any icon), as the pointer goes on a letter, that letter gets highlighted (i.e colors differently).
What i dont want: I dont want you to use different Texts and add them up using an HStack and Foreach, i want it to be all together, since i want it work for all languages and the method mentioned works for language that have unconnected letters only.
is it possible?
Yes, using NSAttributedString, NSTextAttachment can achieve your needs.
I encapsulate it in
HighlightWithCursorLabel:Usage
Result