r/iOSProgramming • • Feb 16 '20

Article How to create Activity Ring in SwiftUI

165 Upvotes

7 comments sorted by

6

u/[deleted] Feb 16 '20

Cool. Bookmarked it.

Theres really a huge lack of tutorials on these circular views.

2

u/carlosmasilva Feb 16 '20

Cool thanks

2

u/datHackerThough Feb 17 '20

One thing I think you don’t discuss in your tutorial is how to input a percentage from a source, and have that appear as a percentage of a ring.

You have 0 as your “no line” and 360 as the full circle. So just bring in your percentage as a decimal and multiply that by 360 to get the right percentage of circle to show.

So 50% is (0.5 * 360) and it’ll show half a circle.

Great tutorial!

0

u/Timmy_the_tortoise Feb 16 '20

This will be very useful for displaying a timer progress in my next app. Thanks!