I have created a countdown timer "Minutes:Seconds" the logic works but I have a display issue. As the numbers change the uilabel text shifts ever so slightly left and right and it is ugly. Any ideas?
This is how I change the label currently
let strMinutes = String(format:" %02d",minutes)
let strseconds = String(format:"%02d",displayseconds)
displayTimeLabel.text = "\(strMinutes):\(strseconds) "
To prevent your digits from shifting, use a font with mono-spaced digits such as Courier New Bold, Helvetica Neue, Verdana, American Typewriter, Chalkboard SE, Copperplate, Gill Sans, Marker Felt, or Trebuchet MS.
You set this in the Attributes Inspector for the label:
I would suggest setting the Alignment to center your text as well.
You can do your code in one line:
displayTimeLabel.text = String(format: " %02d:%02d ", minutes, displayseconds)