-2

I am coding a game in Swift where the player has to make a move within a second, or else time runs out and he/she loses. How can I make an animation that runs every second, resembling the one in the top of Snapchat stories, where it is a filled in circle that slowly "wipes" away in a circular motion like a windshield wiper? Is it just a second-long GIF that I loop every second? Is there a way to do this with native UIKit graphics?

Korpel
  • 2,432
  • 20
  • 30
Joe
  • 33
  • 1
  • 5

1 Answers1

0

I think what you are looking for is a "clock wipe" animation. You can do that by adding a mask layer to your image and animating it using Core Animation.

I wrote a SO post on this very subject: How do you achieve a "clock wipe"/ radial wipe effect in iOS?

Community
  • 1
  • 1
Duncan C
  • 128,072
  • 22
  • 173
  • 272