---
title: "setDelegate(_:)"
framework: securityinterface
role: symbol
role_heading: Instance Method
path: "securityinterface/sfauthorizationview/setdelegate(_:)"
---

# setDelegate(_:)

Sets the delegate for this authorization view.

## Declaration

```swift
func setDelegate(_ delegate: Any!)
```

## Parameters

- `delegate`: The object to which messages about the state of the authorization object should be sent.

## Discussion

Discussion If you want to be notified of state changes (for example, when the user clicks the button), set a delegate and implement the delegate methods described in the delegate methods section.

## See Also

### Setting and getting the delegate for the view

- [delegate()](securityinterface/sfauthorizationview/delegate().md)
