title: iOS - passing Sender (button) name to addSubview
body: <p>I have a main view with 3 buttons. Clicking on any of the buttons adds a SubView.</p>
  
  <p>The buttons have different titles and are all linked to IBAction "switchView"</p>
  
  <p>The "switchView" code is below.</p>
  
  <pre><code>- (IBAction)switchView:(id)sender{
      secondView *myViewController = [[secondView alloc] initWithNibName:@"secondView" bundle:nil];
      [self.view addSubview:myViewController.view];
  }
  </code></pre>
  
  <p>The "secondView" loads up correctly and everything works well.</p>
  
  <p>The problem is I want to be able to know which button was the Sender.</p>
  
  <p>I don't want to create 3 subviews, one for each button. The code and XIB would be absolutely the same></p>
  
  <p>The only difference would be a variable that I would like to set up in the second view (viewDidLoad method) depending on who is the Sender (which button was clicked)</p>
  
  <p>Is this possible? Or I would need to create 3 subViews - one for each button?</p>
  
  <p>Your help is greatly appreciated!</p>