TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | May 2017 |
Maintained by Sergio Fernandez.
To remove the title back button is only necessary to invoke:
// Magic happens here
[SFEmptyBackButton removeTitleFromAllViewControllers];
If you only want to delete the title in certain views invokes this:
[SFEmptyBackButton removeTitleFromViewControllers:@[YourViewController.class, AnotherViewController.class];
When you have a view with a very long title like this:
And navigate to another view with a very long title the following occurs:
If you delete the title back button invoking:
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(-100, 0) forBarMetrics:UIBarMetricsDefault];
Most likely this will happen:
But if you rewrite back button with empty title in all views:
UIBarButtonItem *backButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
[self.navigationItem setBackBarButtonItem:backButtonItem];
You get the desired effect:
Sergio Fernández, [email protected]
This CocoaPod has been made possible thanks to Aspects by @steipete
SFEmptyBackButton is available under the MIT license. See the LICENSE file for more info.