Swift 3: Do I need to link the viewDidAppear function in storyboard?
<p>I am a beginner in Swift. I am trying to make a basic login and account creation system in a single-view Swift 3 project.</p>

<p>In my ViewController.swift, I have a viewDidAppear function:</p>

<pre><code>override func viewDidAppear(_ animated: Bool) {
    self.performSegue(withIdentifier: "loginView", sender: self)
}
</code></pre>

<p>Here is my main storyboard:
<a href="https://i.stack.imgur.com/anGJx.png" rel="nofollow noreferrer">Main.storyboard</a></p>

<p>Upon opening the app, I want the "protected data" page to open first, then check if user has logged in. If not, the login page should appear. However, I don't know how to achieve this. I tried to link navigation controller, but I don't see the function as an option.</p>

<p>Right now, when I run the simulator, only the "protected data" page shows.</p>

<p>What do I do? In addition, is there anything wrong with my viewDidAppear function?</p>