<!--
{
  "availability" : [
    "iOS: 4.0.0 - 10.0.0",
    "iPadOS: 4.0.0 - 10.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "watchOS: 2.0.0 - 3.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UILocalNotification/hasAction",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UILocalNotification(py)hasAction"
  },
  "title" : "hasAction"
}
-->

# hasAction

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

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

## Discussion

Assign <doc://com.apple.documentation/documentation/Swift/false> to this property to hide the alert button or slider. (This effect requires [`alertBody`](/documentation/UIKit/UILocalNotification/alertBody) to be non-`nil`.) The default value is <doc://com.apple.documentation/documentation/Swift/true>.

---

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)