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:
If the user hits CategoryView, depending on the state of his bluetooth connection, he goes to either (this part, so far, works okay):
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:
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.
It sounds like you're testing conditions to determine where you'll segue. If that's the case, perhaps you could test conditions (registered/unregistered, Bluetooth enabled/disabled). Based on the various conditions, you could use performSegueWithIdentifier
to determine where to go next and set up the next ViewController in prepareForSegue
using the a segue identifier, rather than "looking back" to see where you came from.