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.

http://i.stack.imgur.com/zWgLB.png

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.

http://i.stack.imgur.com/PsbYO.png

It should look like this:

http://i.stack.imgur.com/Th0kS.png

Set the Attributes

You could double-click “Item” to change the text to something like “Refresh”, but there is an actual icon for Refresh that you can use. Just select the Attributes Inspector for the UIBarButtonItem and for System Item choose Refresh.

http://i.stack.imgur.com/HWLVq.png

That will give you the default Refresh icon.

http://i.stack.imgur.com/wRDNf.png

Add an IB Action

Control drag from the UIBarButtonItem to the View Controller to add an @IBAction.

class ViewController: UIViewController {

    @IBAction func refreshBarButtonItemTap(sender: UIBarButtonItem) {
        
        print("How refreshing!")
    }
    
}

That’s it.

Notes