title: Creating a segue programmatically without a storyboard
body: <p>Trying to create a segue for my register button which is going to send a user to a page that will allow them to register in my database. </p>
  
  <p>Usually, I make a button and a target for my button which performs some action through a function. </p>
  
  <p><strong>Can we make this function segue</strong> <code>PROGRAMMATICALLY</code> <strong>mind you I haven't used storyboards at all?</strong></p>
  
  <p><strong>Code Snippet:</strong></p>
  
  <pre><code> lazy var registerButton: UIButton = {
  
      let rButton = UIButton(type: .system)
  
       rButton.frame = CGRect(x: 210, y: 600, width: 100, height: 50)
  
      rButton.setTitle("REGISTER", for: .normal)
      rButton.backgroundColor = UIColor.white
      rButton.translatesAutoresizingMaskIntoConstraints = false
      rButton.setTitleColor(UIColor.black, for: .normal)
      rButton.titleLabel?.font = UIFont.boldSystemFont(ofSize: 20)
  
      rButton.layer.cornerRadius = 20
      rButton.layer.borderWidth = 2
  
      rButton.addTarget(self, action: #selector(regSegue), for: .touchUpInside)
  
      return rButton
  }()
  
  // will segue for me
  func regSegue(){
  
  }
  </code></pre>