Trying to make a mutable list of buttons that show on the touch bar
override func windowDidLoad() {
super.windowDidLoad()
let customViewItem = NSCustomTouchBarItem(identifier: NSTouchBarItemIdentifier(rawValue: "identifier"))
customViewItem.view = NSTextField(labelWithString: " ")
groupTouchBarItem.view?.addSubview(customViewItem)
}
But I get Cannot invoke 'addSubview' with an argument list of type '(NSCustomTouchBarItem)'
on the bottom line.
How can I add buttons to the touch bar and remove them at will? Is there an array I can through views into or should I always addSubview on the touchbar view?