Sometimes it can be useful to have a Style capable of transforming the string itself.
Our current use case scenario is this one:
- we are in the middle of development and already have a lot of views with labels. Each label has its custom
Style
- Backend started to send us HTML entities (
& instead of & is the most annoying example).
- Not being able to display HTML entities should be an issue on the
UILabel
Another use case scenario is this #91
I believe something like this could work:
Style {
$0.color = UIColor.black
$0.transform = { text in
text.replacingOccurrences(of: "&:", with: "&")
}
}
Or even something more complex like BonMot is doing here
I'll try to put together a PR.
Sometimes it can be useful to have a
Stylecapable of transforming the string itself.Our current use case scenario is this one:
Style&instead of&is the most annoying example).UILabelAnother use case scenario is this #91
I believe something like this could work:
Or even something more complex like BonMot is doing here
I'll try to put together a PR.