I want to develop a touchpad application. I searched the Internet and saw some lessons. They all make a demonstration using the windowcontroller and simply redefine makeTouchBar()or drag the touch panel in the storyboard, then there is a touch panel. But I want the viewbar in the control panel to be different. Then I put on the touch panel in the viewcontroller in the storyboard and tied the control panel in the viewcontroller.

bind(#keyPath(touchBar), to: self, withKeyPath: #keyPath(touchBar), options: nil)
But when I start the project, I can’t find my touch panel, and then type touchbar.isVisible, and I found that the value is false.

So, how to show the control panel in the viewcontroller. Thank!
source
share