I want to make some operations when boolean values of property goes true to false and false to true.
I've set the getter setter for that, so I can do those operations on setter of boolean property.
But always crashes with EXC_BAD_ACCESS code = 2, can anyone help me to understand this what's wrong I'm doing here.
var reportActivityStarted:Bool {
set {
if self.reportActivityStarted {
//Operations when boolean is true
}else{
//Operations when boolean is false
}
}
get{
return self.reportActivityStarted
}
}
When I changes it's boolean value, it crashes at get{
self.reportActivityStarted = true