extension UIFeedbackGenerator {
static func notificationFeedback(style: UINotificationFeedbackGenerator.FeedbackType = .success) {
let generator = UINotificationFeedbackGenerator()
generator.prepare()
generator.notificationOccurred(style)
}
static func impactFeedback(style: UIImpactFeedbackGenerator.FeedbackStyle = .medium) {
let generator = UIImpactFeedbackGenerator(style: style)
generator.prepare()
generator.impactOccurred()
}
static func selectionFeedback() {
let generator = UISelectionFeedbackGenerator()
generator.prepare()
generator.selectionChanged()
}
}
Created
February 10, 2019 09:33
-
-
Save KentarouKanno/b907036569ba513d4a0b60fab5c5c1f3 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment