---
title: UIFeedbackGenerator
framework: uikit
role: symbol
role_heading: Class
path: uikit/uifeedbackgenerator
---

# UIFeedbackGenerator

The abstract superclass for all feedback generators.

## Declaration

```swift
@MainActor class UIFeedbackGenerator
```

## Overview

Overview Don’t subclass or create instances of this class yourself. Instead, instantiate one of the concrete feedback generator subclasses: UIImpactFeedbackGenerator. Use impact feedback to indicate when an impact occurs. For example, you might trigger impact feedback when a user interface object collides with something or snaps into place. UISelectionFeedbackGenerator. Use selection feedback to indicate a change in selection. UINotificationFeedbackGenerator. Use notification feedback to indicate successes, failures, and warnings. UICanvasFeedbackGenerator. Use canvas feedback to indicate when a drawing event occurs, such as an object snapping to a guide or ruler. For more information, read Playing haptic feedback in your app.

## Topics

### Initializing a feedback generator

- [init(view:)](uikit/uifeedbackgenerator/init(view:).md)

### Preparing to generate feedback

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

### Deprecated

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

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Inherited By

- [UICanvasFeedbackGenerator](uikit/uicanvasfeedbackgenerator.md)
- [UIImpactFeedbackGenerator](uikit/uiimpactfeedbackgenerator.md)
- [UINotificationFeedbackGenerator](uikit/uinotificationfeedbackgenerator.md)
- [UISelectionFeedbackGenerator](uikit/uiselectionfeedbackgenerator.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [UIInteraction](uikit/uiinteraction.md)

## See Also

### Haptic feedback

- [Playing haptic feedback in your app](applepencil/playing-haptic-feedback-in-your-app.md)
- [UIImpactFeedbackGenerator](uikit/uiimpactfeedbackgenerator.md)
- [UINotificationFeedbackGenerator](uikit/uinotificationfeedbackgenerator.md)
- [UISelectionFeedbackGenerator](uikit/uiselectionfeedbackgenerator.md)
- [UICanvasFeedbackGenerator](uikit/uicanvasfeedbackgenerator.md)
