In my iOS app, I want the user to log in with facebook on page1, then get redirected to page2. On page2, there is a "Yes" and "No" button. Now, there are two scenarios:
1-If user pushes "No" he stays on page2. If he logs out from app and logs in back in future again, he again goes to page2 until he pushes "Yes" eventually.
2-User pushes "Yes" on page2. Now, he gets redirected to page3. From now on, every time user logs out and logs back in, he gets redirected to page3 directly without seeing page2. This is the part I am having trouble understanding how to implement in my code. Is there a way to initialize a global variable at start of my "ViewController.swift" code, but update its' value with a new value at the part of the code that takes care of actions if user pushes "Yes"? I mean is it possible to update the value of a variable from one thing to another at initialization?
Actually, maybe the shorter way to explain my question is: Could I initialize a variable in swift with some value at first, then, after user performs a specific action such a pushing a button, I change the initialization value permanently afterwards that action?
Also, please do let me know if you know any other ways to accomplish this.