Search code examples
ioscocoa-touchuibuttonuibarbuttonitemstyle

Use UIBarButtonItem icon in UIButton


UIBarButtonItem has multiple icons available. Is it possible to use the icon which appears after setting its identifier to 'trash':

trash icon

with an UIButton? There is no straighforward method to do that like setting the identifier or style.


Solution

  • Download the image from somewhere on the web, add it to your project and set the UIButton's image to the image you just downloaded.

    I did not find the same as Apple is using but I found this one. Simply change it's color in Pixelmator or Photoshop.