This one’s really quick and simple!

First create a timer (at class level probably, so it doesn’t go out of scope):

Then inside whatever function you need:

Follow it by creating the ‘Tick’ selector specified in the above (it’s just a plain ol’ function):

Now whatever you need to run periodically will do so (every 1.0 seconds as in this example).

See, told ya it was simple!

Where to go Next

This tutorial comes straight out of The Complete iOS Developer Course. Over 40 hours long it contains everything you need to create awe inspiring apps fast!

Click here to check it out!

How to Schedule a Repeating Task using Swift

Leave a Reply

Your email address will not be published. Required fields are marked *

Share This

Want this Post in Easy to Understand Video Form?

Then get theĀ Complete iOS Developer Course. Over 50 hours of pure Swift coding goodness designed to turn you into a coding master!

One Time Offer - $9! Click to Get it!



WARNING: Once this box is closed the offer will not be shown again.

Thank you!