iOS/Sources/Shared/Utilities/Haptics.swift

17 lines
453 B
Swift

import Foundation
import UIKit
public class Haptics {
public static let shared = Haptics()
private init() {}
public func play(_ feedbackStyle: UIImpactFeedbackGenerator.FeedbackStyle) {
UIImpactFeedbackGenerator(style: feedbackStyle).impactOccurred()
}
public func notify(_ feedbackType: UINotificationFeedbackGenerator.FeedbackType) {
UINotificationFeedbackGenerator().notificationOccurred(feedbackType)
}
}