I have been working on my app for a while now and all of a sudden, I realised something weird. I always thought that the variable that was declared before viewDidLoad only gets called on startup when the ViewController appears. However, it appears that the program goes back to the variables when I have break points on them.
My program has five tabs. And I put break points on all variables and IBOutlets that was declared before the viewDidLoad. This happens on all viewControllers expect the one that has no code in it (newly created VC).
I am suspecting the code goes to it but doesn't actually do anything?
For example, in one of the VC I declared
var downloadComplete: Bool = false
After the download is completed, the value is set to true. However, the program goes back to the var downloadComplete: Bool = false at some point but my program doesn't do anything unusual thinking that it is still true.