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?) -> NSPredicateParameters
- significantEvent:
The significant event to compare against. Valid values for this parameter are
HMSignificantEventSunriseandHMSignificantEventSunset. - 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.