HapticsButtonSwiftUI can be installed with the Swift Package Manager:
https://github.com/SNQ-2001/HapticsButtonSwiftUI
You can also clone the repository and build the library locally.
import HapticsButtonSwiftUI
Button(haptics: .impact(.medium)) {
// action
} label: {
Text("Medium")
}
or
import Haptics
Haptics.impact(.medium).play()
or
import Haptics
playImpactHaptic(.medium)
HapticsButtonSwiftUI is available under the MIT license. See the LICENSE file for more info.