UINavigationBar custom back button without title
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
In UIKit, the back button title is derived from the previous view controller's navigation item. If you want the standard back behavior but no visible title, the cleanest solution is to configure the previous screen rather than replacing the button on the current screen.
Why the Back Title Comes from the Previous Screen
This detail trips people up: the back button shown on DetailViewController is controlled by ListViewController, because the navigation bar uses the previous item's backBarButtonItem or back button display settings.
If you set properties on the current view controller after it has been pushed, the default back item may already be derived from the previous controller's title. That is why many "custom back button" attempts accidentally break the swipe-to-go-back gesture or require manual pop logic.
Preferred Solution on Modern iOS
On iOS 14 and later, Apple added backButtonDisplayMode, which is the simplest way to hide the title while keeping the standard arrow and navigation behavior.
Set it on the previous screen:
When ListViewController pushes another screen, the next screen shows the back indicator without the text label. This keeps the system appearance, accessibility behavior, and interactive pop gesture intact.
Custom Back Indicator Image Without a Title
If you want a branded arrow, configure the navigation bar appearance rather than creating a plain left bar button item. This keeps the default navigation behavior while changing the visual asset.
Combine this with .minimal on the previous controller and you get a custom icon with no title.
Older UIKit Approach
If you support earlier iOS versions, set an empty-titled UIBarButtonItem on the previous controller:
This changes the text displayed when the next controller is shown, while the navigation controller still manages the pop action.
You can push the detail screen normally:
No custom selector is necessary unless you truly want a nonstandard navigation flow.
When to Use a Fully Custom Button
There are cases where you want a left bar button item with custom layout, analytics, or multiple actions. In that case, create one intentionally and wire the pop behavior yourself:
This works, but it is more code and you lose some of the built-in behavior unless you reproduce it carefully.
Common Pitfalls
The most common mistake is setting backBarButtonItem on the destination controller. The back button belongs to the previous navigation item, so that code appears to do nothing.
Another pitfall is replacing the default back button when only the title needs to disappear. A custom left item can disable the interactive swipe-back gesture and create inconsistent accessibility behavior.
Developers also forget that appearance APIs and per-screen navigation item settings solve different problems. Use appearance for the global icon and tint, and use the previous controller's navigation item for the title behavior.
Finally, test on the iOS versions you support. backButtonDisplayMode is excellent, but it is not the universal fallback for older deployments.
Summary
- The back button shown on a screen is configured by the previous view controller.
- On iOS 14 and later,
navigationItem.backButtonDisplayMode = .minimalis the cleanest way to hide the title. - Use
UINavigationBarAppearanceto provide a custom back indicator image while keeping system behavior. - For older iOS versions, set an empty
backBarButtonItemon the previous controller. - Only create a fully custom left button when you really need nonstandard behavior.
Related reading
- UINavigationBar Hide back Button Text
- UINavigationController back button custom text?
- UINavigationController without navigation bar?
- UIPageViewController return the current visible view
- UIPanGestureRecognizer - Only vertical or horizontal
- UIPopovercontroller dealloc reached while popover is still visible
- UIRefreshControl - beginRefreshing not working when UITableViewController is inside UINavigationController
- UIRefreshControl on UICollectionView only works if the collection fills the height of the container
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.