2

I am developing an app, that has a custom view in the menu bar. The menu bar extra is a custom NSView that is redrawn every second. When I open the NSMenu of the view, the view freezes and no longer redraws itself. I am using

self.graph.needsDisplay = true

to trigger a redraw.

Is it possible to refresh a NSView in the menu bar when the NSMenu is opened?

inexcitus
  • 2,471
  • 2
  • 26
  • 41

1 Answers1

2

turns out it was a duplicate of this topic

The solution is to add the timer to the RunLoop:

RunLoop.main.add(timer, forMode: .commonModes)
Community
  • 1
  • 1
inexcitus
  • 2,471
  • 2
  • 26
  • 41