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

Dynamic height for static table cells with wrapping labels?

Use UITableView’s heightForRowAtIndexPath : – (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { int topPadding = 10; int bottomPadding = 10; float landscapeWidth = 400; float portraitWidth = 300; UIFont *font = [UIFont fontWithName:@”Arial” size:22]; //This is for first cell only if you want for all then remove below condition if (indexPath.row == 0) // for cell with … Read more