<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecurityInterface",
  "identifier" : "/documentation/SecurityInterface/SFAuthorizationPluginView/buttonPressed(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Security Interface"
    ],
    "preciseIdentifier" : "c:objc(cs)SFAuthorizationPluginView(im)buttonPressed:"
  },
  "title" : "buttonPressed(_:)"
}
-->

# buttonPressed(_:)

Tells the authorization plug-in that the user pressed a button in the custom view.

```
func buttonPressed(_ inButtonType: SFButtonType)
```

## Parameters

`inButtonType`

The type of button that was pressed.

## Discussion

By default, [`buttonPressed(_:)`](/documentation/SecurityInterface/SFAuthorizationPluginView/buttonPressed(_:)) will set a result of Deny when the OK or Login buttons are pressed. An [`SFAuthorizationPluginView`](/documentation/SecurityInterface/SFAuthorizationPluginView) subclass needs to override this method to set the context values for the short name of the user so that user attributes can be looked up. To do this, use <doc://com.apple.documentation/documentation/Security/kAuthorizationEnvironmentUsername> as the key. A subclass should also set any additional context values that are needed by the authorization plug-in to verify the user’s credentials. To do this, use the appropriate function pointers you receive from [`callbacks()`](/documentation/SecurityInterface/SFAuthorizationPluginView/callbacks()).

When you override this method, do not call `[super buttonPressed]`.

---

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)