mirror of
https://github.com/home-assistant/iOS.git
synced 2026-06-16 13:26:27 -05:00
25 lines
576 B
Swift
25 lines
576 B
Swift
#if os(iOS)
|
|
import Foundation
|
|
#if canImport(UIKit)
|
|
import UIKit
|
|
#else
|
|
import AppKit
|
|
#endif
|
|
|
|
public protocol ImpactFeedbackGeneratorProtocol {
|
|
func impactOccurred()
|
|
func impactOccurred(style: UIImpactFeedbackGenerator.FeedbackStyle)
|
|
}
|
|
|
|
final class ImpactFeedbackGenerator: ImpactFeedbackGeneratorProtocol {
|
|
func impactOccurred() {
|
|
impactOccurred(style: .medium)
|
|
}
|
|
|
|
func impactOccurred(style: UIImpactFeedbackGenerator.FeedbackStyle) {
|
|
let generator = UIImpactFeedbackGenerator(style: style)
|
|
generator.impactOccurred()
|
|
}
|
|
}
|
|
#endif
|