Show Another View On level completion

Hi, I am Sanjiv, a Highschool student who is trying to participate in wwdc student scholarship , and I have a doubt in swift I have two bool variables, one global and one local. Once the value of the global variable changes I want the value of the local variable also to change. I want this for navigation. I have a gameScene and once the level is completed it needs to go to the next navigation view. I have tried multiple methods but none worked. Any help will be appreciated.

Accepted Reply

You need a single source of truth for your boolean. Hint: $State and $Binding are your friends.

You would do well to go through the tutorial at https://developer.apple.com/tutorials/app-dev-training/getting-started-with-scrumdinger

It is well worth the time.

Replies

You need a single source of truth for your boolean. Hint: $State and $Binding are your friends.

You would do well to go through the tutorial at https://developer.apple.com/tutorials/app-dev-training/getting-started-with-scrumdinger

It is well worth the time.