Type Method

predicateForEvaluatingTrigger(occurringAfter:applyingOffset:)

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

Declaration

class func predicateForEvaluatingTrigger(occurringAfter 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 after a significant event, the properties of the NSDateComponents object must be positive values. For example, to specify 30 minutes after 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(occurringBefore: String, applyingOffset: DateComponents?) -> NSPredicate

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

Deprecated