DEV Community

Caleb Hearth
Caleb Hearth

Posted on • Originally published at on

sensoryFeedback Samples App

An iPhone 15 Pro in portrait orientation showing the SensoryFeedbackSamples app. The app consists of a search box, a list of buttons with labels for each sensoryFeedback modifier, and a bottom toolbar with filter buttons indicating platforms.

SensoryFeedbackSamples is an Open Source multiplatform SwiftUI app that provides a testing palette for SwiftUI’s new .sensoryFeedback(_, trigger:) modifier.

Something I find is often missing in my personal apps is the haptic feedback that more polished apps manage. While doing a quick search for how to add these effects, I found that in relatively recent OS versions1 there is a new modifier that accepts a SensoryFeedback instance representing a “canned” bit of haptic and/or audio feedback and some kind of trigger, the simplest being an Equatable.

The actual vibrations and audio of each SensoryFeedback aren’t documented–it would be pretty difficult to do so–so I thought it would be useful to throw together a quick app that would let me “play” each of them with a button press. And so, SensoryFeedbackSamples is born!

It provides a list of buttons, each of which play some variant of SensoryFeedback. The supported platforms for each are indicated and there is search (by name of...

Read More

Top comments (0)