r/iOSProgramming • • Jan 25 '22

Application Made the activity start animation using SwiftUI that shows in the workouts app when you start a workout.

195 Upvotes

8 comments sorted by

8

u/richiejmoose Jan 26 '22

Looks cool, but some thoughts..

Why not use a progress view with a custom ProgressViewStyle? Unless you’re targeting iOS 13 that’d be the way to do it.

You could also use a single text view for the number and animate the value, rather than 3 text views animating in and out.

Also the states could be combined into one object so you’re not manually tracking multiple states for essentially the same thing.

2

u/mageshsridhar Jan 26 '22

Yes. I agree with all of them and I did try all of them but it quite didn’t work. I had to separate the text view for the scale bounce effect to work properly. And states are separate because the animation is different for the circle and the text views.

18

u/IUserGalaxy Jan 26 '22

WHEN DOes IT START

3

u/[deleted] Jan 26 '22

Cool

2

u/macdigger Jan 26 '22

Oh that’s a pretty cool move to hook animation timing to date change! I went to have a look at the code just to check how you handle that part of logic and damn, nice, nice! :)