Daily iOS
iOS system design

System scheduling for an alarm app

You're designing an iPhone alarm app. When you have to guarantee the user is alerted at a set time, which system API do you use instead of an in-app Timer?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

So the system fires it even when the app is terminated or suspended in the background, register a local notification request with UNUserNotificationCenter using a UNCalendarNotificationTrigger, and give each alarm a fixed identifier so it can be edited and canceled.

Share a question