Member-only story

Manage UIBarButton in iOS

Mr.Javed Multani
2 min readOct 5, 2020

--

Parameter

title style target action

Description

The UIBarButtonItem title
The style of the UIBarButtonItem
The object to receive the UIBarButtonItem action
The selector (method) to be performed when the UIBarButtonItem is pressed

Creating a UIBarButtonItem in the Interface Builder

The example below shows how to add a navigation bar button (called a UIBarButtonItem) in the Interface Builder. Add a Navigation Controller to your Storyboard
Select your View Controller and then in the Xcode menu choose Editor > Embed In > Navigation Controller.

Alternatively, you could add a UINavigationBar from the Object Library.

Add a Bar Button Item
Drag a UIBarButtonItem from the Object Library to the top navigation bar.

It should look like this:

--

--

Mr.Javed Multani
Mr.Javed Multani

Written by Mr.Javed Multani

Software Engineer | Certified ScrumMaster® (CSM) | UX Researcher | Youtuber | Tech Writer

No responses yet