Initializer

init(timeInterval:repeats:)

Creates a time interval trigger from the specified time value.

Declaration

convenience init(timeInterval: TimeInterval, repeats: Bool)

Parameters

timeInterval

The time (in seconds) that must elapse from the current time before the trigger fires. This value must be greater than zero.

repeats

Specify false to deliver the notification one time. Specify true to reschedule the notification request each time the notification is delivered. If this parameter is true, the value in the timeInterval parameter must be 60 seconds or greater.

Return Value

A new time interval trigger based on the specified temporal information.

Discussion

If you specify true for the repeats parameter, you must explicitly remove the notification request to stop the delivery of the associated notification. Use the methods of UNUserNotificationCenter to remove notification requests that are no longer needed.