Class

UNCalendarNotificationTrigger

A trigger condition that causes a notification to be delivered at a specific date and time.

Declaration

@interface UNCalendarNotificationTrigger : UNNotificationTrigger

Overview

Create a UNCalendarNotificationTrigger object when you want to schedule the delivery of a local notification at the specified date and time. You specify the temporal information using an NSDateComponents object, which lets you specify only the time values that matter to you. The system uses the provided information to determine the next date and time that matches the specified information.

Listing 1 creates a trigger that delivers its notification every morning at 8:30. The repeating behavior is achieved by specifying true for the repeats parameter when creating the trigger.

Listing 1

Creating a trigger that repeats at a specific time

NSDateComponents* date = [[NSDateComponents alloc] init];
date.hour = 8;
date.minute = 30; 
UNCalendarNotificationTrigger* trigger = [UNCalendarNotificationTrigger
                     triggerWithDateMatchingComponents:date repeats:YES];

Topics

Creating a Calendar Trigger

+ triggerWithDateMatchingComponents:repeats:

Creates a calendar trigger from the specified date components.

Getting the Trigger Information

- nextTriggerDate

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

dateComponents

The date components used to construct this object.

Relationships

See Also

Triggers

UNTimeIntervalNotificationTrigger

A trigger condition that causes a notification to be delivered after the specified amount of time elapses.

UNLocationNotificationTrigger

A trigger condition that causes a notification to be delivered when the user's device enters or exits the specified geographic region.

UNPushNotificationTrigger

A trigger condition that indicates the notification was sent from Apple Push Notification Service (APNs).

UNNotificationTrigger

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