<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameController",
  "identifier" : "/documentation/GameController/GCControllerButtonInput/setValue(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Game Controller"
    ],
    "preciseIdentifier" : "c:objc(cs)GCControllerButtonInput(im)setValue:"
  },
  "title" : "setValue(_:)"
}
-->

# setValue(_:)

Sets the pressure value of a snapshot of a button.

```
func setValue(_ value: Float)
```

## Parameters

`value`

A normalized number between `0.0` (minimum pressure) and `1.0` (maximum pressure).

## Discussion

This method does nothing if the associated controller isn’t a snapshot (its [`isSnapshot`](/documentation/GameController/GCController/isSnapshot) property is <doc://com.apple.documentation/documentation/Swift/false>`)`.

---

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)