Instance Method

notificationOccurred(_:)

Triggers notification feedback.

Declaration

func notificationOccurred(_ notificationType: UINotificationFeedbackGenerator.FeedbackType)

Parameters

notificationType

The type of notification feedback. For a list of valid notification types, see the UINotificationFeedbackGenerator.FeedbackType enumeration.

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 Using Feedback Generators.

See Also

Initializing the Notification Feedback Generator