I want to change the name of the mail buttons in the SLComposeServiceViewController. I managed to get UIButton:
NSArray* subviews =[self.navigationController.navigationBar subviews]; UIButton* postButton =[subviews lastObject];
and I tried to set the header as follows:
[postButton setTitle:@"Save" forState:UIControlStateNormal];
but the name has not changed.
Can anyone help me with this?
I saw the Evernote extension on my iPad and it looks like this: 
UPDATE
My decision:
I found a solution for my question, I deleted the original navigation bar and created a custom navigation bar.
I have two navigation panels: 1. with the buttons "cancel" \ "save" 2. with the button "back"
and I change them when navigating to another viewing manager (in my case, I needed to upload a file, and the user needed to select a location from the list)
NOTE. If you do not implement configurationItems , you only need the first navigation bar. (just call to install custom navigation bar from viewDidAppear
So my code is here:
@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]; }
setCancelSaveNavigationItem -> called from viewDidAppear shareViewController
-(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; } }
setBackNavigationItem -> called in configurationItems in self.item.tapHandler function
-(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]; }
Manual Buttons:
- (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]; }
And it works for me !!!
Result:

