0

I am trying to add a "New" button and a "Search" button for my app onto the Touch Bar. In system apps, these are a plus sign and a magnifying glass, respectively. Is there a way to use these system icons on my touch bar buttons, such as in UIBarButtonItems? If not, how can I set a touch bar button's content to be a magnifying glass or plus sign? I am using Swift. Thanks.

TonyStark4ever
  • 848
  • 1
  • 9
  • 24

2 Answers2

1

Maybe you could find those icons in the system files, copy them and use them in your application, but I would not recommend it. They are Apple's intellectual property and you are not allowed to use them for public projects.

You should search on sites like flaticon.com for similar artworks or create them yourself.

Tom K
  • 19
  • 7
1

Apple provides many system icons that you can use in your app. The Human Interface Guidelines has a nice visual reference of all of the icons available here. These can be referenced in your app by using the associated NSImage.Name constant (also described in the HIG).

As an example, the new and search images can be gotten using:

let addImage = NSImage(named: .touchBarAddTemplate)
let searchImage = NSImage(named: .touchBarSearchTemplate)
Taylor
  • 3,183
  • 17
  • 18