---
title: hasAction
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uilocalnotification/hasaction
---

# hasAction

A Boolean value that controls whether the notification shows or hides the alert action.

## Declaration

```swift
var hasAction: Bool { get set }
```

## Discussion

Discussion Assign false to this property to hide the alert button or slider. (This effect requires alertBody to be non-nil.) The default value is true.

## See Also

### Composing the alert

- [alertBody](uikit/uilocalnotification/alertbody.md)
- [alertAction](uikit/uilocalnotification/alertaction.md)
- [alertTitle](uikit/uilocalnotification/alerttitle.md)
- [alertLaunchImage](uikit/uilocalnotification/alertlaunchimage.md)
- [category](uikit/uilocalnotification/category.md)
