Type Method

predicateForEvaluatingTrigger(occurringBefore:applyingOffset:)

Creates a predicate that evaluates whether the event occurred before a significant event.

Declaration

class func predicateForEvaluatingTrigger(occurringBefore significantEvent: String, applyingOffset offset: DateComponents?) -> NSPredicate

Parameters

significantEvent

The significant event to compare against. Valid values for this parameter are HMSignificantEventSunrise and HMSignificantEventSunset.

offset

An offset from the time of the significant event. To specify an offset before a significant event, the properties of the NSDateComponents object must be negative values. For example, to specify 30 minutes before sunset, set the minute property to -30.

Return Value

A predicate object that represents a condition to evaluate before executing the scene.

See Also

Deprecated Symbols

func addEvent(HMEvent, completionHandler: (Error?) -> Void)

Adds a new event to the event trigger.

Deprecated
func removeEvent(HMEvent, completionHandler: (Error?) -> Void)

Removes the specified event from the event trigger.

Deprecated
class func predicateForEvaluatingTrigger(occurringAfter: String, applyingOffset: DateComponents?) -> NSPredicate

Creates a predicate that evaluates whether the event occurred before a significant event.

Deprecated