I try to add action when a tap gesture start and end but its not work !!! and bellow the example code.
@State private var opacity = 1.0
var body: some View {
Image(systemName: "plus.square.on.square")
.opacity(opacity)
.onTapGesture {
opacity = 0.2
}
.gesture(
TapGesture()
.onEnded({ _ in
opacity = 1.0
})
)
}