title: How to recognize a button press for programmatic UIButton Xcode
body: <p>Im using this code to create UIBarButtons programmatically on my Navigation Bar, how can I set the Buttons to send IBActions programmatically. I.O.W. how can I programmatically place a view to recognize the UITapGestureRecognizer(set the touchUpInside event) and connect it to an IBAction?</p>
  
  <pre><code>self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:153/256.0 green:204/256.0 blue:51/256.0 alpha:1.0];
  
  self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
  
  self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
  
  self.navigationItem.title = @"Feed";
  
  UIBarButtonItem *cameraItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:self action:nil];
  UIBarButtonItem *postItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"myIcon.png"] style:UIBarButtonItemStyleBordered target:self action:nil];
  
  UIBarButtonItem *addPlusItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:nil];
  UIBarButtonItem *optionsItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"myIcon2.png"] style:UIBarButtonItemStyleBordered target:self action:nil];
  
  NSArray *cameraAndPostItem = @[cameraItem, postItem];
  NSArray *addPlusAndOptionsItem = @[optionsItem, addPlusItem];
  
  self.navigationItem.leftBarButtonItems = cameraAndPostItem;
  self.navigationItem.rightBarButtonItems = addPlusAndOptionsItem;
  </code></pre>
  
  <p><strong>EDIT:</strong> I am trying to perform a segue when the user presses the UIBarButtonItem, which I have implemented programmatically.</p>