<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMCharacteristicWriteAction/init(characteristic:targetValue:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMCharacteristicWriteAction(im)initWithCharacteristic:targetValue:"
  },
  "title" : "init(characteristic:targetValue:)"
}
-->

# init(characteristic:targetValue:)

Initialize a characteristic write action with a specified characteristic and target value.

```
init(characteristic: HMCharacteristic, targetValue: TargetValueType)
```

## Parameters

`characteristic`

The characteristic.

`targetValue`

The target value for the characteristic.

## Return Value

A newly initialized characteristic write action object with the specified characteristic and target value.

## See Also

  [HomeKit Developer Guide](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/HomeKitDeveloperGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40015050)



---

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)