title: ios share extension post button title
body: <p>I want to change the title of post buttons in SLComposeServiceViewController.
  I managed to get the UIButton: </p>
  
  <pre><code>NSArray* subviews =[self.navigationController.navigationBar subviews];
  UIButton* postButton =[subviews lastObject];
  </code></pre>
  
  <p>and i tried to set title like this:</p>
  
  <pre><code>[postButton setTitle:@"Save" forState:UIControlStateNormal];
  </code></pre>
  
  <p>but the title not changed.</p>
  
  <p>Can anyone help me with this?</p>
  
  <p>I saw Evernote's share extension on my iPad and it looks like this:
  <img src="https://i.stack.imgur.com/6kSqd.jpg" alt="enter image description here"></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p><strong>My Solution:</strong></p>
  
  <p>I found solution for my question,I removed the original navigation bar and create custom nav bar.</p>
  
  <p>I have two nav bar:
  1. with "cancel"\"save" buttons
  2. with "back" button </p>
  
  <p>and I change them when navigate to other viewcontroller
  (in my case I needed to upload file and user need select location from list)</p>
  
  <p>NOTE: if you not implement <code>configurationItems</code> you need only the first nav bar. (just call to set custom nav bar from <code>viewDidAppear</code></p>
  
  <p>So my code is here:</p>
  
  <pre><code>@property (strong, nonatomic) UINavigationBar *customNavBar;
  
  -(void) viewDidAppear:(BOOL)animated
  {
      [super viewDidAppear:animated];  
      self.customNavBar = [[UINavigationBar alloc] initWithFrame:self.navigationController.navigationBar.bounds];
      [self.navigationController.navigationBar removeFromSuperview];
      [self.navigationController.view addSubview:self.customNavBar];
      [self setCancelSaveNavigationItem];
  }
  </code></pre>
  
  <p>setCancelSaveNavigationItem--> called from viewDidAppear of shareViewController</p>
  
  <pre><code>-(void)setCancelSaveNavigationItem
  {
      UINavigationItem *newItem = [[UINavigationItem alloc] init];
      UIBarButtonItem *cancelBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel",nil)  style:UIBarButtonItemStylePlain target:self action:@selector(cancelButtonTapped:)];
      UIBarButtonItem *saveBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Done",nil)  style:UIBarButtonItemStyleDone target:self action:@selector(saveButtonTapped:)];
      newItem.leftBarButtonItem = cancelBarButtonItem;
      newItem.rightBarButtonItem = saveBarButtonItem;
      [self.customNavBar setItems:@[newItem]];
      [self.navigationItem setBackBarButtonItem:cancelBarButtonItem];
      [self.navigationItem setRightBarButtonItem:saveBarButtonItem];
      if(self.item.value == nil){
          saveBarButtonItem.enabled = NO;
      }
  }
  </code></pre>
  
  <p>setBackNavigationItem--> called in <code>configurationItems</code> -->in <code>self.item.tapHandler</code> function</p>
  
  <pre><code>-(void)setBackNavigationItem
  {
      UINavigationItem *newItem = [[UINavigationItem alloc] init];
      UIBarButtonItem *selectBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Select",nil)  style:UIBarButtonItemStylePlain target:self action:@selector(selectButtonTapped:)];
      UIBarButtonItem *backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:[NSString stringWithFormat:@"❮ %@", NSLocalizedString(@"Back",nil)]  style:UIBarButtonItemStylePlain target:self action:@selector(backButtonTapped:)];
      newItem.leftBarButtonItem = backBarButtonItem;
      newItem.rightBarButtonItem = selectBarButtonItem;
      [self.customNavBar setItems:@[newItem]];
      [self.navigationItem setBackBarButtonItem:backBarButtonItem];
      [self.navigationItem setRightBarButtonItem:selectBarButtonItem];
  }
  </code></pre>
  
  <p>Handle buttons tapped:</p>
  
  <pre><code>- (void)backButtonTapped:(id)sender {
      if([self.navigationController.viewControllers count] ==2){
          [self setCancelSaveNavigationItem];
      }
      [self.navigationController popViewControllerAnimated:YES];
  }
  
  - (void)cancelButtonTapped:(id)sender {
      [self cancel];
  }
  
  - (void)selectButtonTapped:(id)sender {
      ...
      [self setCancelSaveNavigationItem];
      [self popConfigurationViewController];
  }
  
  - (void)saveButtonTapped:(id)sender {
      ...
      [self cancel];
  }
  </code></pre>
  
  <p>And it's work for me!!!</p>
  
  <p>The result:</p>
  
  <p><a href="https://i.stack.imgur.com/Euwvk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Euwvk.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/96yxl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/96yxl.png" alt="enter image description here"></a></p>