<!--
{
  "availability" : [
    "iOS: 27.2.0 -",
    "iPadOS: 27.2.0 -",
    "macCatalyst: 27.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeExtensions",
  "identifier" : "/documentation/HomeExtensions/HomeAccessoryToggleSetting/init(id:label:isEnabled:defaultValue:currentValue:onLabel:offLabel:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "HomeExtensions"
    ],
    "preciseIdentifier" : "s:14HomeExtensions0A22AccessoryToggleSettingC2id5label9isEnabled12defaultValue07currentK07onLabel03offN0ACSS_AA0aceN0VS2bSgAmLSgANtcfc"
  },
  "title" : "init(id:label:isEnabled:defaultValue:currentValue:onLabel:offLabel:)"
}
-->

# init(id:label:isEnabled:defaultValue:currentValue:onLabel:offLabel:)

Creates a toggle setting.

```
init(id: String, label: HomeAccessorySettingLabel, isEnabled: Bool = true, defaultValue: Bool? = nil, currentValue: Bool? = nil, onLabel: HomeAccessorySettingLabel? = nil, offLabel: HomeAccessorySettingLabel? = nil)
```

## Parameters

`id`

A unique identifier for the setting.

`label`

The setting’s label.

`isEnabled`

A Boolean value that indicates whether people can change the setting. The default is `true`.

`defaultValue`

The value to use when there’s no current value.

`currentValue`

The setting’s current value.

`onLabel`

The label to display when the setting is on.

`offLabel`

The label to display when the setting is off.

---

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)