Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 1.19 KB

README.md

File metadata and controls

20 lines (14 loc) · 1.19 KB

SUIToolbarPlay

Sample code for programmatically creating NSToolbar and hook it to a NSWindow

Toolbar icons are from Josh Hughes' Perspective Icons set.

Creating toolbar programmatically

This sample coode is base on the Xcode template when you create a macOS SwiftUI app. Changes that are relevant are in these 2 files:

  • AppDelegate.swift
  • Toolbar.swift

I have also created a post accompanying this sample code: https://medium.com/@billibala/swiftui-how-to-add-a-toolbar-to-window-in-macos-app-fc8da5947fe8

References

Sample code and documentation that help me make this sample code: