Class

UNTimeIntervalNotificationTrigger

Triggers the delivery of a local notification after the specified amount of time.

Overview

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)

Symbols

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.

Relationships