Skip to content

Commit

Permalink
(feat) Haptic feedback on iOS when logging drink succeed.
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLeungYL committed Nov 17, 2024
1 parent f8fecbf commit d6abb1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Shared/CupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ struct CupView: View {
}
#if os(watchOS)
WKInterfaceDevice.current().play(.success)
#elseif os(iOS)
// Vibrate on iOS when drink logging succeed.
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
impactMed.impactOccurred()
#endif
} label: {
Image(systemName: "mouth.fill")
Expand Down

0 comments on commit d6abb1e

Please sign in to comment.