I want to transition from ViewController to secondViewController, when the user presses a UIButton, using code only in Swift.
//Function to transition
func
Updated for Swift 3, some of these answers are a bit outdated.
let mainStoryboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let vc : UIViewController = mainStoryboard.instantiateViewController(withIdentifier: "myStoryboardID") as UIViewController
self.present(vc, animated: true, completion: nil) }