Scheduling notifications with time, calendar, and location triggers in iOS
Learn how to schedule local notifications using different trigger types with the UserNotifications framework.
12 May 2025 · 4 min read
The UserNotifications framework provides several flexible ways to schedule local notifications, depending on when and how we want them to be delivered.
In this guide, we'll walk through the three main types of triggers available for local notifications:
- Time interval triggers – fire after a set number of seconds
- Calendar triggers – fire at a specific date and time
- Location triggers – fire when the user enters or exits a geographic region
Let's jump in.

Time interval trigger
A time interval trigger is the simplest option. It fires after a fixed amount of time has passed, making it perfect for short-term reminders or countdowns. For example, to trigger a notification 10 minutes from now, we would use:
import UserNotificationslet trigger = UNTimeIntervalNotificationTrigger(timeInterval: 10 * 60, repeats: false)
Calendar trigger
A calendar trigger allows us to schedule notifications based on specific dates and times or repeating intervals. This is ideal for recurring reminders, like daily health checks or weekly meeting reminders. For example, we can trigger a notification every morning at 7:30 with the following code:
var dateComponents = DateComponents()dateComponents.hour = 7dateComponents.minute = 30let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true)
This trigger provides a lot of flexibility, as we can match on any combination of date components, like weekday, month, or year, to precisely control when notifications are delivered.
Location trigger
A location trigger is a more context-aware option that fires when a user enters or exits a specified geographic region. For example, we can trigger a notification when a user exits a 20 km radius around Leipzig's city center:
import CoreLocationlet center = CLLocationCoordinate2D(latitude: 51.3396955, longitude: 12.3730747)let region = CLCircularRegion(center: center, radius: 20 * 1000, identifier: "leipzig")region.notifyOnEntry = falseregion.notifyOnExit = truelet trigger = UNLocationNotificationTrigger(region: region, repeats: false)
With the notifyOnEntry and notifyOnExit properties, we can control whether the app should deliver notifications when the user enters, exits, or both. Keep in mind that location triggers require location permissions and can be affected by power-saving modes.



Newsletter
Like to support my work?
Say hi
Related tags
Articles with related topics
Latest articles and tips



