0

Is there an API to set a timer in Apple's Clock app to a specific countdown?

I know there is the Reminders SDK and EventKit, but I was looking for setting the timer and not a reminder.

Timer in the Clock app

Tamás Sengel
  • 55,884
  • 29
  • 169
  • 223
OscarTheGrouch
  • 2,374
  • 4
  • 28
  • 39

1 Answers1

1

No, there is no available API for this. You should create a custom timer inside your app to replicate that functionality.

Use the Timer class of Foundation to make a simple timer in your application.

let timer: Timer!

timer = Timer.scheduledTimer(withTimeInterval: 60, repeats: false) { timer in
    [completion code]
}

For more information about creating a timer with a countdown, check out this question.

Tamás Sengel
  • 55,884
  • 29
  • 169
  • 223