Draw countdown circles

2019-05-18 01:08发布

I would like to draw, in a ViewController, a countdown like in the following image:

countdown

Unfortunately, I don't have any idea on how to realize this. I will be please if someone could give me a clue on this.

Cheers.

Cyril

2条回答
贼婆χ
2楼-- · 2019-05-18 01:34

A quick thought, I would not like to draw it by using any iOS frameworks :), Just use small UIWebView and run javascript(Only works if user enables javascript, but hey I have seen no one yet who doesn't use javascript).

Javascript polar time can be found on internet, open source like,

http://oneorangesoftware.com/polartimer/

change and edit a bit and off you go! Awesome time!

Cheers!

If you don't like above approach than you may look into this code,

http://www.herbert-siojo.com/2011/04/19/drawing-a-countdown-timer-ios/

nicely crafted however to achieve same look as yours you may have to tweak a bit!

Beware of this line in code,

[self performSelector:@selector(cancelPie:) withObject:timer afterDelay:sliderIntervalDelay.value];

just change to,

[self performSelector:@selector(cancelPie:) withObject:timer afterDelay:60.0];

Credit : Goes to a developer who posted their code on http://www.herbert-siojo.com/2011/04/19/drawing-a-countdown-timer-ios/.

查看更多
孤傲高冷的网名
3楼-- · 2019-05-18 01:58

LOL, I am considering to write one like this these days. You would definitely like this. :]

Check it out here: Circle-Counter-Down

ScreenShot

查看更多
登录 后发表回答