Anyway I can change MaterialSwitch
to return true/false instead of on/off?
print(switch.switchState) // prints true
Hearing nothing else, I improvised and created a new bool
variable. Then I just used if
statements to set it correctly by accessing the hashValue
.
if self.option1.switchState.hashValue == 1 {
option1Value = false
} else {
option1Value = true
}