---
title: "notificationOccurred(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uinotificationfeedbackgenerator/notificationoccurred(_:)"
---

# notificationOccurred(_:)

Triggers notification feedback.

## Declaration

```swift
func notificationOccurred(_ notificationType: UINotificationFeedbackGenerator.FeedbackType)
```

## Parameters

- `notificationType`: The type of notification feedback. For a list of valid notification types, see the doc://com.apple.uikit/documentation/UIKit/UINotificationFeedbackGenerator/FeedbackType enumeration.

## Discussion

Discussion This method tells the generator that a task or action has succeeded, failed, or produced a warning. In response, the generator may play the appropriate haptics, based on the provided UINotificationFeedbackGenerator.FeedbackType value. For more information on setting up a feedback generator, see the UIFeedbackGenerator class.

## See Also

### Related Documentation

- [prepare()](uikit/uifeedbackgenerator/prepare().md)

### Producing notification feedback

- [notificationOccurred(_:at:)](uikit/uinotificationfeedbackgenerator/notificationoccurred(_:at:).md)
- [UINotificationFeedbackGenerator.FeedbackType](uikit/uinotificationfeedbackgenerator/feedbacktype.md)
