-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create TTTAttributedLabelLink class, and use it to manage default/active/inactive link state and accessibility values for non-default link types #419
Conversation
getaaron
commented
Jul 14, 2014
- Create TTTAttributedLabelLink class, and use it to manage default/active/inactive link state and accessibility values for non-default link types
- Updates example project to compile properly with this new class
- Update documentation
Thanks for your work on this, @getaaron. Some quick feedback:
|
Thanks for the thorough feedback. 👍 for combining into one file.
The only reason is backwards compatibility.
This could be simplified with breaking changes, but my instinct was to avoid that.
There are two issues with this approach:
These issues are resolvable, but I think would add more complexity to the class than currently exists.
Currently, all links have a text checking result. What would a link without a result do?
👍
The links would need to inform the label about this change, which is fine if we decide to move forward with your suggestion to remove the direct initializer for
We could. Do you mean so other developer can store information there? They could use
I don't think there should be one in this PR, because this PR is intended primarily to fix #331 and the inflexibility of Furthermore, adding |
I have not yet tried @getaaron changes but looking at the commit and explanations they feel sound. Very interesting discussion. Looking forward getting these changes merged into the official repo. Also, consider the possibility of adding block based link handlers, this looks like a good opportunity for that. |
I would echo some of Mattt's comments above, in particular:
For bonus points:
|
Done:
Not Done:
Marking link properties as TTTAttributedLabelLink *newLink = [[TTTAttributedLabelLink alloc] init];
newLink.result = // some result…
newLink.activeAttributes = // some attributes…
[label addLink:newLink]; So I didn't move forward with that for now. We could add a custom initializer (
No tests… yet. |
Also, we should look at the implementation of @kylef @jhersh I added you as collaborators on my fork if you want to make any changes. I probably won't be able to get back to this until the weekend. |
I'm okay with that. We're gonna need a bigger initializer ⛵
Wasn't this one of @kylef's concerns in the first place? It'd be good to try and square this one away. |
Yes, but without any changes he can work around it now. What should the expected behavior of
|
@getaaron Quoting the docs, nothing should happen if the attributes there are nil.
So according to that, I think it should create a link with no active, inactive attributes |
@kylef Just pushed some changes. I tried to minimally change the behavior of |
Thanks @getaaron! Would you consider squashing your commits, rebasing, and removing your deletion of the |
@jhersh Done. |
I updated some docs and did some minor cleanup. Thanks for this @getaaron! |