How do I Reset Numbers on Xcode?

I want to know how to make numbers reset back to zero once they have reached a certain number, like once a number reaches 10 it automatically goes back to zero. Please let me know as soon as possible. Thank you.

hello, you can simply put an if statement that checks your number, if it reaches your condition so can simply “reset” the number by setting it again like “number = 0”

Hey, thank you so much for your help but would you know the formula also

@fuerte.francis did mention the formula!!

Create an if statement for yourself variable.
Once it’s at a certain number, inside the if, reset back to 0