Contents

init(significantEvent:offset:)

Creates a new significant time event with the specified significant event and offset.

Declaration

init(significantEvent: HMSignificantEvent, offset: DateComponents?)

Parameters

  • significantEvent:

    The significant event for this trigger, for example Sunrise.

  • offset:

    A date components instance that represents the offset from the significant event that this event fires.

Return Value

An initialized significant time event which fires at the specified offset from the provided significant event.

Discussion

To specify that this event should fire before the significant event, supply a date components object with negative values. For example, to specify 30 minutes before sunset, the minute property of the offset argument must be set to -30.