evermeer / AttributedTextView

Easiest way to create an attributed UITextView (with support for multiple links and from html)
Other
440 stars 55 forks source link

Setting of attributer changes selectable and editable #24

Closed ankraft closed 6 years ago

ankraft commented 6 years ago

Assigning a new text to the attributer always changes the current values of the editable and selectable attributes as well. Is it really necessary to change the attributes in the attributer setter?

One can re-set those attributes after an assignment, but I would prefer not to do this all the time.

evermeer commented 6 years ago

Ah, good question, These are needed when you are using links in your attributed text. I guess you then only want and need to set these if there are actual links in the tekst. I could make setting these optional by checking: if _attributer.urlCallbacks.count > 0 {

I will investigate if I could change it to printing a warning if they are not set.

evermeer commented 6 years ago

If using makeInteract it really does not work without these 3 properties set like this. But from now on they will only be set if you have used makeInteract. I have published this change as version 1.1.0

ankraft commented 6 years ago

Thanks a lot for fast change! I can confirm that 1.1.0 works for my application. One suggestion: perhaps you can add a short explanation in the documentation?

evermeer commented 6 years ago

I added a short statement to the readme.