How would I in UIKit in iOS 26 put e.g. a login button on the trailing side of a navigationbar?
Asked on 2025-11-12
1 search
In iOS 26, to place a login button on the trailing side of a navigation bar in a UIKit app, you can use the UINavigationItem to manage the bar button items. You can assign your login button as a right bar button item to achieve this. Here's a brief overview of how you can do it:
-
Create a Bar Button Item: Initialize a
UIBarButtonItemwith your login button. -
Assign to Navigation Item: Set this bar button item to the
rightBarButtonItemsproperty of yourUINavigationItem.
Here's a simple code example:
let loginButton = UIBarButtonItem(title: "Login", style: .plain, target: self, action: #selector(loginAction))
self.navigationItem.rightBarButtonItem = loginButton
This will place the login button on the trailing side of the navigation bar. The system will automatically handle the layout and appearance, including the new glass appearance introduced in iOS 26.
For more details on navigation bars and toolbars in the new design, you can refer to the session Build a UIKit app with the new design.

Build a UIKit app with the new design
Update your UIKit app to take full advantage of the new design system. We’ll dive into key changes to tab views, split views, bars, presentations, search, and controls, and show you how to use Liquid Glass in your custom UI. To get the most out of this video, we recommend first watching “Get to know the new design system” for general design guidance.

Make your UIKit app more flexible
Find out how your UIKit app can become more flexible on iPhone, iPad, Mac, and Apple Vision Pro by using scenes and container view controllers. Learn to unlock your app’s full potential by transitioning from an app-centric to a scene-based lifecycle, including enhanced window resizing and improved multitasking. Explore enhancements to UISplitViewController, such as interactive column resizing and first-class support for inspector columns. And make your views and controls more adaptive by adopting new layout APIs.

Build a SwiftUI app with the new design
Explore the ways Liquid Glass transforms the look and feel of your app. Discover how this stunning new material enhances toolbars, controls, and app structures across platforms, providing delightful interactions and seamlessly integrating your app with the system. Learn how to adopt new APIs that can help you make the most of Liquid Glass.
