I am trying to show a toast when the user hits the register button and then direct the user to the login screen as follows:
print("Registration Successful")
self.view.makeToast("Registration Successful")
let nextViewController = self.storyboard?.instantiateViewControllerWithIdentifier("LoginViewController") as! LoginViewController
self.navigationController?.pushViewController(nextViewController, animated: true)
But the problem here is that screen changes quickly due to which the toast can hardly be read. I would like to show the "Successful" toast and then change the screen. Can someone help me with it.