james
james

Reputation: 643

How to draw a Custom Progress Cycle with PaintCode

I am a starter with PaintCode and Know how to draw a Progress bar, but How to draw a image like below.Thks for help with a parameter I can control the number and the Progress

enter image description here

Upvotes: 3

Views: 464

Answers (2)

Jared
Jared

Reputation: 180

you can do it using end or start angle parameter of oval and one variable (value: 0.0-1.0) and two expressions: angle = (360-value*360) textValue = stringFromNumber(100*value) +"%". Seet this screenshot. Your drawing method is then: - (void)drawProgressWithValue: (CGFloat)value. It is really easy.

Making progress arc in PaintCode

— PaintCode Support

Upvotes: 2

Tricertops
Tricertops

Reputation: 8512

Nice trick is to use Pattern Stroke with large Gap (like 1000) and attach variable to Dash attribute. This way you can create any bezier shape and animate it’s stroke as progress bar.

See this video: Animating Apple Watch Activity Rings (at around 3:40)

Upvotes: 0

Related Questions