Swift - How do I segue from ViewController to TabBarController

davidgilman picture davidgilman · May 24, 2015 · Viewed 7.8k times · Source

How do I add a ViewController before a TabBarController in Swift? I am using Parse to make a custom login in the ViewController which would lead to the TabBarController... Help would be appreciated!

Answer

Chameleon picture Chameleon · May 24, 2015

1. Control-drag from yellow symbol (ViewController) to the TabBarController

enter image description here


This will create a segue in your ViewController menu

enter image description here


2. Click this new segue "Show segue to Tab..." and in identity inspector set an identifier name.

enter image description here


3. Now when you want to make the segue happen, use call...

performSegueWithIdentifier("WhatEveryYouNamedSegue", self)