StyledTextKit icon indicating copy to clipboard operation
StyledTextKit copied to clipboard

Make NSLinkAttribute to tappable and highlighting.

Open ryohey opened this issue 7 years ago • 4 comments

Hi, Thank you for this amazing library.

I have a question about links and attributes. StyledTextKit provides three attributes .tapable, .tapHighlight, .highlight. Are there use-cases for using these attributes separately? These just increase complexity in my opinion.

As alternative for UITextView, Is it not enough to have only NSLinkAttribute?

ryohey avatar Aug 13 '18 05:08 ryohey

@ryohey NSLinkAttribute has some weird default styling that you can't override, pretty funky behavior.

.tapable is only in an example

We could def use some documentation the two highlight options.

@kylelol now that I'm reading the code, did #47 change the behavior of .highlight? If you were previously using that to do interactive highlighting, do you now have to know to update your code to use .tapHighlight from now on?

rnystrom avatar Sep 22 '18 20:09 rnystrom

@rnystrom oh i see. I didn't know that's behavior. now I think it is a good to use .highlight. I hope that .highlight is the only attribute to do interactive highlighting.

ryohey avatar Sep 23 '18 02:09 ryohey

@rnystrom ah you are right, I think if you were previously using .highlight you would have to update your code to use .tapHighlight. I can switch it back to the way it was to prevent regressions, and maybe pick a more descriptive name like .interactiveHighlight

kylelol avatar Sep 24 '18 16:09 kylelol

@kylelol that’d be great!

Sent with GitHawk

rnystrom avatar Sep 24 '18 16:09 rnystrom