-2

I'm wanting to create a progress bar that's completed at the end of the day.
Wanting to keep it as a really simple red bar that stretches out as the day goes by. Any ideas?

luker82
  • 31
  • 2

3 Answers3

1

You will have to create a UISlider and you will give minimum and maximum value the 0 and 24*60 and each minute you can update the value of the slider or you can convert the current time to minutes and then update the slider's value.

Vasilis D.
  • 1,416
  • 13
  • 21
1

You can use UIProgressView and set its progress property as you need. It's the most simple way.

IBAction
  • 2,131
  • 2
  • 9
  • 14
0

Progress bar takes in values from 0.0 to 1.0. You can convert the unit of day in percentage and then set it to the progress view. Its up to you to decide which unit you want to show the progress in.

Say I wanted to show the progress w.r.t hours passed in the day, then take the hours passed from current time and calculate the percentage w.r.t 24 hours. So at noon it would be 12/24 which gives me 0.5, assign this value to the progress bar.

GoodSp33d
  • 6,252
  • 4
  • 35
  • 67