I want to keep each sentence in the paragraph it's own Text
view, because it has unique functionality on hover. Currently I'm using the WrappingHStack
from here.
WrappingHStack(1...6, id:\.self) {
Text("This is number \($0). ")
}
This creates text like this:
This is number 1. This is number 2. | // bounds
This is number 3. This is number 4. |
This is number 5. This is number 5. |
What I want is like this:
This is number 1. This is number 2. This
is number 3. This is number 4. This is
number 5. This is number 6.
What's the best way to achieve this?
EDIT:
More context on what I'm trying to achieve. Let's say I have two sentences: Does the seal work?
and el sello funciona?
When a user hovers on seal
, I'd like to highlight sello
(that logic I can implement as the two sentences are structured and broken down). Where i'm struggling is to get text to look like a regular block of text, but to have unique hover behaviour on the sentence/word level.