Fashion
Fashion copied to clipboard
Changing styles in case of table cell selection not working
First of all, very thank you for this nice library.
I tried to change the style of tableViewCell title when user selects the cell item. But, it doesn't seem to be changing the style.
For e.g., In my custom cell,
override func setHighlighted(_ highlighted: Bool, animated: Bool) {
super.setHighlighted(highlighted, animated: animated)
if (highlighted) {
styles = LabelStyle.mainMenuCellSelected.rawValue
highlightedView.isHidden = false
} else {
styles = LabelStyle.mainMenuCellNormal.rawValue
highlightedView.isHidden = true
}
}
It's not changing the style at all. Correct me If I missed anything obvious. Any help would be appreciated.
Hi @dineshrajas. Don't see anything wrong with your code, are you sure you register you styles and stylesheet with Fashion.register
? Have you tried to change color directly in setHighlighted
method to see that it's being called?
Yeah, I tired. @vadymmarkov
It was working if I change the color
directly. I haven't gone through your code. But, I think it's not updating the style every time when you change it. But, only when the cell is awakeFromNib
.
Also, yes, that style is registered already with Fashion
.