Embed a UIViewController in a NavigationController using segues

In your Storyboard, you can embed a ViewController in a Navigation Controller by selecting the View Controller and then picking from the menu at the top Editor->Embed In->Navigation Controller. From another view controller, you control drag to this Navigation controller to set up the modal segue. You can also control drag to the original View … Read more

Passing variables between view controllers

After performSegueWithIdentifier:sender: your view controler will call – (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender assuming your new view controller has some propertys to set: if ([[segue identifier] isEqualToString:@”NextView”]) { MyViewController *myVC = [segue destinationViewController]; myVC.propertyToSet = // set your properties here }

Does anyone know what the new Exit icon is used for when editing storyboards using Xcode 4.5?

I had a hard time following the accepted answer so here is more detail. Given the photo below on view controller C you can “exit” back to any view controller in the segue path. ViewController A you can write: – (IBAction)done:(UIStoryboardSegue *)segue { // Optional place to read data from closing controller } ViewController B … Read more

iOS 9 Segue Causes App To Freeze (no crash or error thrown)

So basically the segue was freezing because of the UITextView‘s I was using in the destinationViewController. The following fixed the issue: Delete all UITextView‘s Add new UITextView’s you must leave the default lorem imposed text and change this programmatically in the viewDidLoad() This was the fix for me, and from the research I have done … Read more

How do I create a segue that can be called from a button that is created programmatically?

Here is how to set up a segue so that it can be called programmatically. Control drag from the ViewController icon in the first view controller to the second view controller. Click on the segue arrow between the two view controllers, and in the Attributes Inspector on the right, give the segue an Identifier (tableau … Read more

Prepare for Segue in Swift

This seems to be due to a problem in the UITableViewController subclass template. It comes with a version of the prepareForSegue method that would require you to unwrap the segue. Replace your current prepareForSegue function with: override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) { if (segue.identifier == “Load View”) { // pass data to next view … Read more