Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a plus symbol bar button item

How do you create UIBarButtonItem as a plus symbol? I tried giving it the title "+", but I would like it to look more like the plus symbol you would normally create if you used storyboard. Which doesn't have a background or an underline.

like image 372
icestorm0806 Avatar asked Jun 20 '16 00:06

icestorm0806


People also ask

How do I create a navigation bar in Swift?

Start with Navigation ControllerCreate a single view application in Xcode. Add two view controller into your storyboard. Create two different swift files for those view controllers and set identifiers for them. Take a button in each view controller, set constrain for them and customize as you want.

How do I add a navigation bar to my storyboard?

Go to the Storyboard. Select the View Controller and in The Editor menu select Embed in -> Navigation Controller. Next, drag a Bar Button from the Object Library to the left side of the Navigation Bar and name it "Left Item". Repeat this for the right side and name it "Right Item".


1 Answers

It's one of the provided bar button system items.

let addBarButton = UIBarButtonItem(barButtonSystemItem: .add, target: YOUR_TARGET, action: YOUR_SELECTOR)
like image 153
Andy Ibanez Avatar answered Sep 25 '22 17:09

Andy Ibanez