Suggestion for a Quote of the Day App

I am building an app that will display a new quote every 24 hours. I am using API requests and Notification Center. I save the current/most recent quote fetched in User Defaults.

I am wanting to call the fetch quote function every 24 hours. What code technique would you suggest?

I am wanting to call the fetch quote function every 24 hours. What code technique would you suggest?

No technique, a simple strategy.
  • On your app starting up (including getting foreground), call the API and get the latest

  • While your app is running in the foreground, use timer and check the next update time every minute

  • While your app is in the background or not running, do nothing. Users cannot see background apps

Users cannot see background apps

Users can see background apps in the multitasking UI and one of the goals of iOS’s multitasking support is to allow apps to keep that view up to date.



@andrew_holmes37, What do you mean by this:

I am using API requests and Notification Center.

What are you doing with notifications right now?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

Users can see background apps in the multitasking UI and one of the goals of iOS’s multitasking support is to allow apps to keep that view up to date.

Thanks for the correction. I will search and learn the APIs to keep background apps view up to date.
Suggestion for a Quote of the Day App
 
 
Q