title: How to use push Storyboard Segue for the NavigationController
body: <p>I am new in iOS development. I created an App using Storyboard to navigate to different pages.</p>
  
  <p><img src="https://i.stack.imgur.com/C6Mse.png" alt="enter image description here"> </p>
  
  <p>When I click on the Add BarButton in Customer page --> go to the Add Customer Page.(using <code>Modal</code> Storyboard Segue)</p>
  
  <p>There, when I enter username and password and click on save button --> come back to Customer page.</p>
  
  <p>And everything works fine.</p>
  
  <p>The problem is I want to have <code>back button</code> in Add Customer page. I already know that I can use <code>Push</code> Storyboard Segue, but when I use it I face with an error:</p>
  
  <pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'
  *** First throw call stack:
  (0x13cb022 0x155ccd6 0xeff1b 0xefa24 0x44bde6 0x4404d0 0x13cce99 0x1814e 0x256a0e 0x13cce99 0x1814e 0x180e6 0xbeade 0xbefa7 0xbe266 0x3d3c0 0x3d5e6 0x23dc4 0x17634 0x12b5ef5 0x139f195 0x1303ff2 0x13028da 0x1301d84 0x1301c9b 0x12b47d8 0x12b488a 0x15626 0x25ed 0x2555)
  terminate called throwing an exception(lldb) 
  </code></pre>
  
  <p>CustomerViewController.h:</p>
  
  <pre><code>#import "AddCustomerViewController.h"
      @interface CustomerViewController : UITableViewController&lt;AddCustomerViewControllerDelegate&gt;
      {
          IBOutlet UITableView *tableview;
          NSMutableArray *customers;
      }
  
      @property(nonatomic,retain)IBOutlet UITableView *tableview;
      @property(nonatomic,retain)NSMutableArray *customers;
  
      @end
  </code></pre>
  
  <p>This is the code I use in CustomerViewController.m:</p>
  
  <pre><code>self.customers = [[NSMutableArray alloc]init]; 
  
  -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
      if([segue.identifier isEqualToString:@"AddCustomer"])
      {
          UINavigationController *navigationController = segue.destinationViewController;
          AddCustomerViewController *addCustomerViewController = [[navigationController viewControllers] objectAtIndex:0];
          addCustomerViewController.delegate = self;
      }
  }
  
  -(void) addCustomerViewControllerDidSave: (AddCustomerViewController *) Controller newCustomer: (Customer *) customer
  {
      [self dismissViewControllerAnimated: YES completion:NULL];
      [self.customers addObject:customer];
      [self.tableview reloadData];
  }
  </code></pre>
  
  <p>AddCustomerViewController.h:</p>
  
  <pre><code>#import "Customer.h"
  
  @class AddCustomerViewController;
  
  @protocol AddCustomerViewControllerDelegate &lt;NSObject&gt;
  
  -(void) addCustomerViewControllerDidSave: (AddCustomerViewController *) Controller newCustomer: (Customer *) customer;
  
  @end
  
  @interface AddCustomerViewController : UITableViewController
  {
  
  }
  
  @property (nonatomic, weak) id &lt;AddCustomerViewControllerDelegate&gt; delegate;
  
  @property (nonatomic, strong) IBOutlet UITextField *firstnameTxt;
  @property (nonatomic, strong) IBOutlet UITextField *lastnameTxt;
  
  - (IBAction)save:(id)sender;
  
  @end
  </code></pre>
  
  <p>And AddCustomerViewController.m:</p>
  
  <pre><code>- (void)save:(id)sender 
  {
      NSLog(@"Save");
      Customer *newCustomer = [[Customer alloc]init];
      newCustomer.firstname = self.firstnameTxt.text;
      newCustomer.lastname = self.lastnameTxt.text;
      [self.delegate addCustomerViewControllerDidSave:self newCustomer:newCustomer];
  
  }
  </code></pre>
  
  <p>Can you help me how can I use <code>Push</code> Storyboard Segue (to have back button) ?</p>