PWSwitch icon indicating copy to clipboard operation
PWSwitch copied to clipboard

Is On set to true = wrong appearance

Open peseriusz opened this issue 3 years ago • 0 comments

So, I'm using PWSwitch in my cells, and when first switch state is set to ON, then there is no colour for this state. When I press switch twice, then colour is set properly. PWSwitch is added in xib, colours in PWSwitch.appearance(), and state is updated in sth. like:

func configure(with viewModel: CellViewModel) {
        titleLabel.text = viewModel.mainTitle
        descriptionLabel.text = viewModel.description

        switchButton.setOn(viewModel.isSwitchOn, animated: false)
        switchButton.isHidden = viewModel.isSwitchHidden
}

peseriusz avatar Jun 21 '21 09:06 peseriusz