Merhabalar, SwiftUI 4 ile birlikte artık onTapGesture kullanarak ilgili nesnenin dokunma x,y konumunu elde edebiliyoruz.
struct TapGestureLocationExample: View {
var body: some View {
Rectangle()
.fill(.orange)
.frame(height: 250)
.padding()
.onTapGesture { location in
print(location)
}
}
}
…