Created
August 29, 2018 05:42
-
-
Save trilliwon/691300174a6d014f430d96f846cd87b8 to your computer and use it in GitHub Desktop.
iOS haptic feedback code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// class UINotificationFeedbackGenerator | |
let notificationFeedback = UINotificationFeedbackGenerator() | |
notificationFeedback.notificationOccurred(.success) // .warning, .error | |
// class UIImpactFeedbackGenerator | |
let impactFeedback = UIImpactFeedbackGenerator(style: .light) // .medium, .heavy | |
impactFeedback.impactOccurred() | |
// class UISelectionFeedbackGenerator | |
let selectionFeedback = UISelectionFeedbackGenerator() | |
selectionFeedback.selectionChanged() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment