24 hour analog clock

后端 未结 4 832
醉梦人生
醉梦人生 2020-12-20 08:30

I\'m attempting to make a 24 hour analog clock and currently have a 12 hour clock.

What I wrote:

   currentTime = [NSDate date];
dateComponents = [c         


        
4条回答
  •  萌比男神i
    2020-12-20 08:40

    What you want to do is to wrap the 24 hour clock to 12 hour rotations, you can use a modulo for this like so:

    hourAngle = (30 * (hour % 12) + minute / 2);
    

提交回复
热议问题