Atributika
Atributika copied to clipboard
Why onClick only when style contains any attributes for .highlighted?
I think we shouldn't ask for .highlighted
attributes fo this. Instead it could all be handled in theonClick
configuration block.
After actually using it, it now makes more sense 🤪
Yeah API is not perfect. But haven't been able to find anything better.
Actually, what if add modifier like this:
let a = Style("a").userInteractionEnabled(true).foregroundColor(.blue)
So there is no need to define something special to make text clickable
I am also thinking about macOS, in addition to highlighted, text can have hovered state
Those sound like nice improvements!
Maybe .tapEnabled()
(or click) is a better name. Same for hovering.
userInteractionEnabled is more universal across platforms. Actually I just realized that there is no support for AttributedLabel on macOS :)
This was reworked in V5. Closing this as obsolete