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

Changing styles in case of table cell selection not working #8

Open
dinarajas opened this issue Jan 27, 2017 · 2 comments
Open

Changing styles in case of table cell selection not working #8

dinarajas opened this issue Jan 27, 2017 · 2 comments

Comments

@dinarajas
Copy link

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.

@vadymmarkov
Copy link
Owner

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?

@dinarajas
Copy link
Author

dinarajas commented Jan 31, 2017

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.

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

No branches or pull requests

2 participants