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

# init(id:label:isEnabled:defaultValue:currentValue:placeholder:)

Creates a text field setting.

```
init(id: String, label: HomeAccessorySettingLabel, isEnabled: Bool = true, defaultValue: String? = nil, currentValue: String? = nil, placeholder: LocalizedStringResource? = 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 text to use when there’s no current value.

`currentValue`

The setting’s current text.

`placeholder`

The text to display when the field is empty.

---

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)