Last active
April 28, 2018 11:38
-
-
Save anitaa1990/af72734a99d957597c8a339f52260602 to your computer and use it in GitHub Desktop.
This example illustrates how to push a view controller to the top of the navigation stack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
} | |
@IBAction func handleLoginAction(_ sender: Any) { | |
/* Step 1 */ | |
/* | |
* This example is when we want to push a view controller to the top of the navigation backstack | |
*/ | |
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil) | |
let viewControllerB = storyBoard.instantiateViewControllerWithIdentifier("nextView") as! ViewControllerB | |
self.presentViewController(viewControllerB, animated:true, completion:nil) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment