The time that must expire before the delivery of a local notification.


Use a UNTimeIntervalNotificationTrigger object for local notifications that you want delivered at a time relative to the current time. You specify the number of seconds that must elapse before the notification fires. You can also set up the trigger to repeat at the specified interval.

Always use the init(timeInterval:repeats:) method to create instances of this class. Listing 1 shows an example that creates a trigger to fire once after thirty minutes have elapsed.

Listing 1

Creating a trigger that fires in 30 minutes

// Fire in 30 minutes (60 seconds times 30)
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: (30*60), repeats: false)


Creating a Time Interval Trigger

init(timeInterval: TimeInterval, repeats: Bool)

Creates and returns a time interval trigger from the specified time value.

Getting the Trigger Information

func nextTriggerDate()

The next date at which the trigger conditions will be met.

var timeInterval: TimeInterval

The time interval used to create the trigger.


Conforms To

See Also


class UNCalendarNotificationTrigger

The date and time at which to deliver a local notification.

class UNLocationNotificationTrigger

The geographic location that the user must reach to enable the delivery of a local notification.

class UNPushNotificationTrigger

An object that indicates that a notification was sent from the Apple Push Notification Service.

class UNNotificationTrigger

The common behavior for subclasses that trigger the delivery of a notification.