Skip to content

Instantly share code, notes, and snippets.

View wzbozon's full-sized avatar

Denis Kutlubaev wzbozon

View GitHub Profile
@wzbozon
wzbozon / PressActionsModifier.swift
Created November 22, 2022 19:06 — forked from gabrieltheodoropoulos/PressActionsModifier.swift
PressActions modifier - Handle press and release events in SwiftUI
struct PressActions: ViewModifier {
var onPress: () -> Void
var onRelease: () -> Void
func body(content: Content) -> some View {
content
.simultaneousGesture(
DragGesture(minimumDistance: 0)
.onChanged({ _ in
onPress()