How can I recreate the exact vibration that happens when you hold down on an app icon like this in swift?
The same vibration can be felt when you swipe on a message on Facebook messenger to reply to it.
You can use a UIFeedbackGenerator
for this, for example:
UINotificationFeedbackGenerator().notificationOccurred(.success)
or
UISelectionFeedbackGenerator().selectionChanged()