Apologies, if this is a little unclear - I'm a noob when it comes to iOS programming. Here's the scenario:
I've got a LogInView, a CategoryView, a CheckerView, a WalkthroughView, and a LandingPageView.
The user starts at LogInView, and depending on the app's bluetooth state, and whether or not the user has been registered, either goes to:
- CheckerView (Registered, Bluetooth Off)
- LandingPageView (Registered, Bluetooth On)
- CategoryView (Unregistered)
If the user hits CategoryView, depending on the state of his bluetooth connection, he goes to either (this part, so far, works okay):
- WalkthroughView (Bluetooth on)
- CheckerView (Bluetooth off)
The catch is that CategoryView will always go through WalkthroughView, regardless of whether or not bluetooth is on. So, here's what my storyboard looks like:
A right hot mess, I know. Since both LogInView and CategoryView can, at some point, go into CheckerView, I need a way to check which of the segues was used, such that:
- CheckerView will always go into LandingView if the previous view was LogInView, and
- It will always go into WalkthroughView if the previous view was CategoryView.
I'm vaguely aware of a prepareForSegue
function, but I've no idea yet how to use it, nor where to put it (from the previous page, or on the receiving page?)
Any suggestions? Thanks.