---
title: "init(keyPath:)"
framework: intents
role: symbol
role_heading: Initializer
path: "intents/inparameter/init(keypath:)"
---

# init(keyPath:)

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

## Declaration

```swift
@nonobjc convenience init?<Root, Value>(keyPath: KeyPath<Root, Value>)
```

## Parameters

- `keyPath`: Specifies a path to a value within a type.The intent or intent response class that acts as the root of the specified key path. For example, when specifying properties of a ride request intent, you would specify the doc://com.apple.sirikit/documentation/Intents/INRequestRideIntent class. The path to a property of the specified class. For example, to specify the key path for the doc://com.apple.sirikit/documentation/Intents/INRequestRideIntent/pickupLocation property of a ride request, specify the string pickupLocation.

## Return Value

Return Value An initialized parameter object.

## See Also

### Creating a Parameter Object

- [init(for:keyPath:)](intents/inparameter/init(for:keypath:).md)
