Search code examples
cocoanstoolbar

Safari toolbar UI Design, How to integrate a add button like Safari does it?


Is there is a NSToolbar trick to integrate a add ("+") button in the right lower toolbar corner like Safari does it?

enter image description here


Solution

  • That's an NSTitlebarAccessoryViewController with a layoutAttribute of .Right.

    You can configure it with a view (e.g. the plus button view), and add the view controller to the window with window.addTitlebarAccessoryViewController(NSTitlebarAccessoryViewController)