---
title: "setSelection(_:)"
framework: usdkit
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "usdkit/usdprim/variantset/setselection(_:)"
---

# setSelection(_:)

Sets the variant selection.

## Declaration

```swift
func setSelection(_ variantName: String) throws
```

## Parameters

- `variantName`: The name of the variant to select.

## Discussion

Discussion note: An error if the selection cannot be set.
