Skip to content
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

Data Detectors styling #82

Closed
MacMeDan opened this issue Aug 25, 2017 · 6 comments
Closed

Data Detectors styling #82

MacMeDan opened this issue Aug 25, 2017 · 6 comments

Comments

@MacMeDan
Copy link
Contributor

As a user developing with MessageKit I want to be able to style my Data Detectors text to make my app look fabulous even with custom backgrounds. Currently any text that is detected as a Phone Number, Address or email is a black underlined set of words.

screen shot 2017-08-25 at 3 27 02 pm

We should be able to easily configure this with a convenience method.

@SD10
Copy link
Member

SD10 commented Aug 25, 2017

@MacMeDan You can customize this using the addressAttributes: [String: Any] property of MessageLabel. The thing is -- you can only change attributes that don't change the size of the layout, eg) underline, color, underline color. If you do, the layout won't render correctly.

This is likely to remain a limitation for awhile because fixing it requires the collectionView to know what attributes you're using in advance and also to parse the text for the detectors.

@MacMeDan
Copy link
Contributor Author

I would suggest that we make a method that limits it to just those options underline, color, underline color. This way we do not have people breaking the layout when they style Data Detectors.

@SD10
Copy link
Member

SD10 commented Aug 27, 2017

@MacMeDan I kind of think that too, I even added it at first but removed it because there were 20+ properties. The thing is it doesn't offer any real protection. For example: If you set a different font for the message label than the one set in the layout object -- you will break the layout. We can't make these properties of UILabel private. This just has to be something that is made aware to people as a rule for using the project.

@SD10
Copy link
Member

SD10 commented Sep 1, 2017

Closing this because we have this functionality in v0.6.0

@SD10 SD10 closed this as completed Sep 1, 2017
@SD10 SD10 reopened this Sep 25, 2017
@SD10 SD10 closed this as completed Sep 27, 2017
@agordeev
Copy link

@SD10 How do I access addressAttributes from a subclass of MessagesViewController?

@SD10
Copy link
Member

SD10 commented Nov 21, 2017

@agordeev There's no way to do this from the MessagesViewController. I'm looking to add a delegate method to make this possible. It's blocked by #356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants