Shiv Shiv - 12 days ago 5
iOS Question

iOS Swift - Proper Technique for Segues?

I'm taking my first attempt at a basic Swift iOS app. Below is the storyboard I have so far.

Tab bar app with added login/register views

I have two questions:


  • I currently have it where if the user is not "authenticated" there's a present modally segue from the first tab to the login/register splash screen (black). Is there a better way to redirect app users to the splash screen when the app is first opened and the user isn't authenticated.

  • After the user has successfully logged in, they're taken back to the previous screen (black login/register splash screen). How can I pull the splash screen out the navigation stack so the user is taken straight back to the tabbed view?


Answer
  1. you should use your black splash screen as your "initial view controller".

Your user will start there, and then from there they can click "login" or "signup". depending on what button they selected have them segue accordingly.

2.once your user signs in, under the IBAction signin button or logs in, create a segue to your UITabBarcontroller.

  1. heres a picture example.enter image description here
Comments