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

Feature request: set per-token colors #6

Open
nk9 opened this issue Mar 2, 2018 · 2 comments
Open

Feature request: set per-token colors #6

nk9 opened this issue Mar 2, 2018 · 2 comments

Comments

@nk9
Copy link

nk9 commented Mar 2, 2018

It would be ideal to be able to provide a color per-token, presumably with a delegate method.

It looks like there is a "backgroundColor" property already, but it doesn't seem to be used.

@nk9
Copy link
Author

nk9 commented Mar 2, 2018

Also, if you can point me in the right direction, I’d be up for trying to implement a PR with this.

@akhilcb
Copy link
Owner

akhilcb commented Mar 2, 2018

Thanks for the feature request. I don't think NSTokenField supports this out of the box. You may have to look at some custom implementations for this.

Here is a stackoverflow question:
https://stackoverflow.com/questions/17672413/nstokenfield-different-colors-for-tokens

It seems like you may have to customize token cell. In this case it would beACBTokenFieldCell in file NSTokenField+ACBExtension.swift. You can add a callback block similar to didDeleteTokenBlock.

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

2 participants