I am new to coding and especially swift. I would like to create an app in swift that will add the work week number to the menubar. For example, this week is work week 41, so on the menu bar it would say "WW41".
I know how to print text to the menubar, but just need to add the variable.
to get the work week I am doing this:
let calendar = Calendar.current
let weekOfYear = calendar.component(.weekOfYear, from: Date.init(timeIntervalSinceNow: 0))
To print just text, I am doing this:
let statusBar = NSStatusBar.system
statusBarItem = statusBar.statusItem(
withLength: NSStatusItem.squareLength)
statusBarItem.button?.title = "WW"
I'm just not sure how to write the actual work week number to the menubar. Also, I'm new to stackoverflow so thanks in advance.