Here is the sameple code
@main
struct TestApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
struct ContentView: View {
var body: some View {
DatePicker("test", selection: .constant(Date()), displayedComponents: .date)
.onTapGesture {
print("on tap")
}
}
}