<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMEventTrigger/init(name:events:end:recurrences:predicate:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMEventTrigger(im)initWithName:events:endEvents:recurrences:predicate:"
  },
  "title" : "init(name:events:end:recurrences:predicate:)"
}
-->

# init(name:events:end:recurrences:predicate:)

Creates a new event trigger with the specified name, events, end events, recurrences, and predicate.

```
init(name: String, events: [HMEvent], end endEvents: [HMEvent]?, recurrences: [DateComponents]?, predicate: NSPredicate?)
```

## Parameters

`name`

The name of the event trigger.

`events`

An array of events that can activate the evaluation of the event trigger. The trigger is evaluated if any one of the events is true.

`endEvents`

An array of events that can trigger the end of the scene that this event trigger represents.

`recurrences`

Specifies the days of the week to evaluate the trigger. All properties other than <doc://com.apple.documentation/documentation/Foundation/DateComponents/weekday> on <doc://com.apple.documentation/documentation/Foundation/DateComponents> are ignored.

`predicate`

The predicate to test and activate after evaluating the event trigger. Once activated, the event’s scenes execute. If a value isn’t specified the event trigger executes the scene if any of the events activate.

## Return Value

An initialized event trigger.

---

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)