NSToolbar Class for Swift

a few days ago, Greg0 posted

A few years ago I had written a basic toolbar control for Swift and Gregs post on TOF inspired me to revisit mine and make it a more robust control.

So if you have a need for a NSToolbar class for Swift let me know.

  • supports standard toolbar buttons with either/both Images and Text
  • supports both SPACE and FLEXSPACE items
  • supports all the system toolbar items (Print, Colors, Font, Cloud etc)
  • supports grouped controls with either Icons or Text
  • supports a Searchbar
  • supports a Dropdown Button type
  • supports adding almost any macOS Control that is inherited from NSView (which is most of them)

Written in 100% Swift.

1 Like

nice to see alternatives in other languages posted

Newest version supports SF Symbols as well as PNG images for all toolbar icons


this is the same code as above, but with all SF Symbols instead.

I have added a “commandBar” to this package, it is a custom control similar to a NSToolbar, but is icons only. supports the same icon syntax (SF or PNG), and have overflow ability incase the control is not wide enough for all the buttons… It supports “space” and “flexspace” entries, the rounded borders are computed automatically based on the space entry locations

This example attempts to duplicate the similar control in the Xojo IDE using SF. but the icons are not exactly matching :slight_smile:

1 Like

That’s cool