<!--
{
  "availability" : [
    "iOS: 9.0.0 - 11.0.0",
    "iPadOS: 9.0.0 - 11.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "tvOS: 9.0.0 - 11.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 2.0.0 - 4.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMEventTrigger/predicateForEvaluatingTrigger(occurringBefore:applyingOffset:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMEventTrigger(cm)predicateForEvaluatingTriggerOccurringBeforeSignificantEvent:applyingOffset:"
  },
  "title" : "predicateForEvaluatingTrigger(occurringBefore:applyingOffset:)"
}
-->

# predicateForEvaluatingTrigger(occurringBefore:applyingOffset:)

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

```
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 <doc://com.apple.documentation/documentation/Foundation/NSDateComponents> object must be negative values. For example, to specify 30 minutes before sunset, set the <doc://com.apple.documentation/documentation/Foundation/NSDateComponents/minute> property to `-30`.

## Return Value

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)