I'm learning swift so I'm starting off with a clock app. I'm able to get it working but the styling is not what I expected. When the time changes the whole title shifts. Is it possible to keep text from shifting around?
Here's what's happening: https://i.stack.imgur.com/xowHs.gif
guard let statusButton = statusBarItem.button else { return }
let formatter = DateFormatter()
let timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) { timer in
formatter.dateFormat = "hh:mm:ss.S"
let dateTimeString = formatter.string(from: Date())
statusButton.title = dateTimeString
}
Is align left the solution? If not, what are some options?