I see there is a .onLongPressGesture(minimumDuration:maximumDistance:pressing:perform:).
However there isnt enough documentation for me to understand how to perform an action when the user releases the button.
A good example to understand what I am talking about is when you hold down a button to start recording a video and let go to stop the recording.
.onLongPressGesture(minimumDuration: 0.5, maximumDistance: 100, pressing: {}, perform: {} )
The answer to this is by calling the identifier like this.
@State var hasPressed = false
.onLongPressGesture(minimumDuration: 0.5, maximumDistance: 100, pressing: {
pressing in
self.hasPressed = pressing
if pressing {action1}
if !pressing {action2}
}, perform: {})