class someClass {
var zShowbackdrop : Bool = false
init() {
showBackdrop = true // start the instance with TRUE
}
// THIS IS THE ONLY PLACE "zShowBackdrop" is supposed to change
// the NV message appears ONLY ONCE
public final var showBackdrop : Bool {
get { return zShowBackDrop! }
set { print("NV=\(newValue)"); zShowBackDrop = newValue; invalidate() }
}
public override func draw(_ rect: CGRect) {
super.draw(rect)
print("? \(showBackdrop)") // this shows that the value DID change somehow
if showBackdrop == true {
... do stuff
}
}
create an instance
var temp = someClass()
temp.showBackdrop = false /// THIS HAPPENS ONCE
The draw event is call as required (like PAINT in Xojo)… after a few times, all of a suddend showBackdrop begins returning TRUE again
At NO time did the computed property get executed again (there would have be an “NV” msg)
There are NO other variables or references that might “stomp” on this