iOS - UIBarButtonItem Identifier - option to create "settings" cogwheel button

user1046037 picture user1046037 · Mar 18, 2012 · Viewed 30.3k times · Source

I want to create a UIBarButtonItem to represent the app's settings (cogwheel). Presently I can only find an option to create UIBarButtonItem (Interface Builder > Attributes Inspector > identifier) such as "Add" (+), "Edit", "Done", "Cancel" etc

I can't find an option to create a settings (cogwheel) icon. Is there a way to do this in interface builder or through code?

Or do I have to create an image and then the image ?

Answer

CodaFi picture CodaFi · Mar 18, 2012

Unicode has several notable examples you can simply copy and paste into a string declaration in Xcode, or use the standard Unicode String Escape (\uxxxx) and iOS is actually quite fluent when it comes to Unicode (I know some of the char's are fairly ugly, but that's Unicode for ya'):

Unicode Character 'GEAR WITHOUT HUB' (U+26ED): http://www.fileformat.info/info/unicode/char/26ed/index.htm

Unicode Character 'GEAR' (U+2699): http://www.fileformat.info/info/unicode/char/2699/index.htm

Or prepare an image and set the UIBarButtonItem's customView property accordingly.