Skip to content

Instantly share code, notes, and snippets.

@heriwijoyo
Last active December 20, 2016 04:09
Show Gist options
  • Save heriwijoyo/894d4bb9572f9e295671831b5cd6d59d to your computer and use it in GitHub Desktop.
Save heriwijoyo/894d4bb9572f9e295671831b5cd6d59d to your computer and use it in GitHub Desktop.
class LoginViewController: UIViewController {
...
@IBAction func signUpButtonTapped(sender: UIButton) {
let viewController = RegisterViewController()
self.navigationController?.pushViewController(viewController, animated: true)
}
func backToPreviousScreen() {
self.navigationController?.popToRootViewControllerAnimated(true)
}
...
}
internal class RegisterViewController: UIViewController {
...
@IBAction func pushLoginPage(sender: AnyObject) {
let viewController = LoginViewController()
self.navigationController?.pushViewController(viewController, animated: true)
}
func backToPreviousScreen() {
self.navigationController?.popToRootViewControllerAnimated(true)
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment