How to navigate between view using Segways?

I searched in Google a clear answer how to implement transition between ViewController when condition but never found
if Code == self.CompleteCode.text!{

}

After this condition, you need to go to the next View, via Segway, help please
June 3rd 19 at 19:07
2 answers
June 3rd 19 at 19:09
Solution
self.performSegue(withIdentifier: "yourSegueIdentifier", sender: self)
June 3rd 19 at 19:11
Solution
if Code == self.CompleteCode.text! {
 performSegue(withIdentifier: "showChapter", sender: nil) //sender can throw what you want to transfer to another View
}

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 if segue.identifier == "yourSegue" {
 let vc = segue.destination as! YourNewViewController
 //Here you can pass any parameters to the other View
}
}

Find more questions by tags Swift