Search code examples
swifttvos

Create an alarm on tvOS with Swift


How can I get an event to schedule for execution at a particular time of day using tVOS since it does not use UILocalNotification / alarm /reminder or EventKit?

I just basically want a few events to happen when the app is in the foreground at a particular time of day via some sort of scheduling at a particular time of the day for tVOS


Solution

  • I just ended up calculating the time difference between now and the time to schedule and run a performSelectorAfterDelay on the custom methods that need to be launched at the scheduled time provided the app is running in the foreground.