title: Swift - Open new View after click on Button
body: <p>I would like to open new View after clicking on a button. It works, when I make it by UIButton in Main.storyboard, however, I need to make it in code, because I have to use some if-statements with login/password. I tried to make it like it was suggested in other similar questions, but it doesn't work: </p>
  
  <pre><code>@IBAction func login(_ sender: UIButton) {
  
     performSegue(withIdentifier: "Second", sender: self)} 
  </code></pre>
  
  <p>Id of login-view: <strong>First</strong>;</p>
  
  <p>Id of the second view: <strong>Second</strong></p>
  
  <p><a href="https://i.stack.imgur.com/0ZauD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0ZauD.png" alt="enter image description here"></a></p>