Swift - value of bool being changed without doing anything? Cant find where its being altered?

I swear to god I have a rogue variable here - I have a bool

menuUp

that simply tells whether some menu buttons have been moved up or not.

I first declare the bool as false then depending on the bool (if the menu is up or not), an animation will run on a swipe gesture/function.

var menuUp = Bool(false) //at class level

I have set numerous breakpoints and print statements but it seems as though the bool is being modified without me doing anything. When the app loads I have my super view controller call this function, printing the following and making

//above change the duration to the time it will take,
//and fiddle with the springs between 0-1 until you are happy with the effect.
self.menuBtn1.center.y -= screenSize.height * (122/568)
self.menuBtn2.center.y -= screenSize.height * (122/568)
self.menuBtn3.center.y -= screenSize.height * (122/568)
//chnage frame however you want to here

}, completion: { finished in
//code that runs after the transition is complete here

})
menuUp = !menuUp
}

print(menuUp)

}

So its true. Great. THEN in another class I reference this super viecontorller like this and on a button try to call the menu down function, which can also be called by swiping down on the super view controller -

//above change the duration to the time it will take,
//and fiddle with the springs between 0-1 until you are happy with the effect.
self.menuBtn1.center.y += screenSize.height * (122/568)
self.menuBtn2.center.y += screenSize.height * (122/568)
self.menuBtn3.center.y += screenSize.height * (122/568)
//chnage frame however you want to here

}, completion: { finished in
//code that runs after the transition is complete here

})
menuUp = !menuUp
}

print(menuUp)

}

And this function IS CALLEd however it prints -
And at the beginning of the function that calls the above func Ive printed out the bool and it is false here also.

Oddly, when I trigger

moveMenuDown

with a swipe it outputs correctly (starts true, ends false).

The menu is still clearly up I can see it so I KNOW the bool should not/is not false.

Because it is reading ht bool as false, it does not call the animation and move th menu down in

moveMenuDown

. This is a major problem.

What can I do here? Ive tried clicking the magnify glass to find all the places I reference the bool but I don't change it ANYWHERE outside the super view controller and I only changed it TWICE in those 2 functions.

Whats going on?

EDIT:

I now have

weak var superv: StarterViewController!

in the class of the super view controller and Ive written in the other, sub view controller:

You are actually creating a new instance of StarterViewController! Whenever a StarterViewController is created, its instance properties get initialized. One of them is menuUp, which gets initialized to false.

Do you see that? The superv you created is not the controller which has menuUp set to true earlier. It's a completely different and independent instance of StarterViewController.

To fix this, you need to assign self to superv after you created the "another class" that you were talking about.

let theOtherClass = TheOtherClass(...)
theOtherClass.superv = self

And also, you should change the declaration of superv to this:

weak var superv: StarterViewController!

Email codedump link for Swift - value of bool being changed without doing anything? Cant find where its being altered?