Home > Net >  How to perform a task every day at a certain time in Swift
How to perform a task every day at a certain time in Swift

Time:08-15

So I made an app using swift and swift ui and need to get the next item in an array, retrieved from firebase, every day. Think of it like how the Wordle site gets a new word every day at a certain time. I looked everywhere for how to accomplish this, but it simply didn't exist.

CodePudding user response:

There are many ways to perform a task every day at a certain time in Swift. Here are some of the most common:

  1. Use a timer.

  2. Use an alarm.

  3. Use a calendar.

  4. Use a repeating task.

CodePudding user response:

You can use Firebase schedule functions. Write a function that will be triggered in every 24h. (But not sure if this is included in their free plan). This answer also discusses some alternative options u can use to achieve the above result.

  • Related