title: How to add an action to share button in navigation bar with Xcode
body: <p>I am trying to add an action to my share button in navigation bar but I don't know how and where to define my "shareAction" method. To add share button, I have the following code in viewWillAppear :</p>
  
  <pre><code>UIBarButtonItem *shareButton = [[UIBarButtonItem alloc]
                                  initWithBarButtonSystemItem:UIBarButtonSystemItemAction
                                  target:self
                                  action:@selector(shareAction:)];
  self.navigationItem.rightBarButtonItem = shareButton;
  </code></pre>