ACBTokenField icon indicating copy to clipboard operation
ACBTokenField copied to clipboard

Feature request: set per-token colors

Open nk9 opened this issue 6 years ago • 2 comments

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 avatar Mar 02 '18 00:03 nk9

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

nk9 avatar Mar 02 '18 18:03 nk9

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.

akhilcb avatar Mar 02 '18 19:03 akhilcb