Skip to content

Instantly share code, notes, and snippets.

@jobedylbas
Last active April 24, 2020 14:37
Show Gist options
  • Save jobedylbas/10a1cf9bcfcf4e4b1d1a79f53dc1a5e1 to your computer and use it in GitHub Desktop.
Save jobedylbas/10a1cf9bcfcf4e4b1d1a79f53dc1a5e1 to your computer and use it in GitHub Desktop.
private func animate() {
var imageIndex: Int = 0
Timer.scheduledTimer(withTimeInterval: 0.025, repeats: true) { timer in
if imageIndex < self.imageNames.count {
self.image = Image(self.imageNames[imageIndex])
imageIndex += 1
}
else {
timer.invalidate()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment