<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SiriKit",
  "identifier" : "/documentation/Intents/INParameter/init(for:keyPath:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Intents"
    ],
    "preciseIdentifier" : "c:objc(cs)INParameter(cm)parameterForClass:keyPath:"
  },
  "title" : "init(for:keyPath:)"
}
-->

# init(for:keyPath:)

Creates a new parameter object using the specified key path and class information.

```
convenience init(for aClass: AnyClass, keyPath: String)
```

## Parameters

`aClass`

The intent or intent response class that contains the specified key path. For example, when specifying properties of a ride request intent, you would specify the [`INRequestRideIntent`](/documentation/Intents/INRequestRideIntent) class.

`keyPath`

The path to a property of the specified class. For example, to specify the key path for the [`pickupLocation`](/documentation/Intents/INRequestRideIntent/pickupLocation) property of a ride request, specify the string `pickupLocation`.

## Return Value

An initialized parameter object.

## Discussion

If any properties in the key path contain an array or ordered set, use the [`setIndex(_:forSubKeyPath:)`](/documentation/Intents/INParameter/setIndex(_:forSubKeyPath:)) method to specify which object in those properties to use.

---

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)