SwiftUI - Dismiss Keyboard when Picker selected
问题 Is there a simple means of dismissing the keyboard or any other active control when another control such as a date picker becomes active? Or vice versa. There are some solutions for dismissing the keyboard, but which also disable the use of a picker. Possibly there is an event other than onTapGesture to use. Follows is some sample code that illustrates the problem. struct TestView: View { @State private var firstname = "" @State private var surname = "" @State private var birthdate = Date()