I'm trying the easiest thing in the book: create an applet for the top menu bar; some kind of status indicator. However, I've been through 3 tutorials and nothing does it: the app compiles but will not show anything in the menu bar. Here is the code:
import SwiftUI
@NSApplication
class AppDelegate: NSObject, NSApplicationDelegate {
var statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
func applicationDidFinishLaunching(_ aNotification: Notification) {
self.statusItem.button?.title = "TEST"
}
}
As I said, nothing but the name of my App shows in the menu bar. And I still don't know how to get an output (I just need a print statement to work)