How can I switch the view controller using UIButton? Here is my code:
@IBAction func scanAction(sender: AnyObject) {
//switch view controller
}
When I click the Scan button, it will go to a login form.
My view controller in Main.storyboard is like this
How might I proceed?
I already found the answer
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
let nextViewController = storyBoard.instantiateViewControllerWithIdentifier("nextView") as NextViewController
self.presentViewController(nextViewController, animated:true, completion:nil)