PWSwitch
PWSwitch copied to clipboard
Is On set to true = wrong appearance
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
}