SwiftUI: how to create custom UIDatePicker
问题 I succeeded to create UIDatePicker inside SwifUI, but when I change the date wheel in picker the date value not update, here is my code: struct DatePicker: UIViewRepresentable { @Binding var date: Date func makeUIView(context: Context) -> UIDatePicker { let view = UIDatePicker() view.datePickerMode = .date return view } func updateUIView(_ uiView: UIDatePicker, context: Context) { uiView.date = date } } Then I call it from the view like this: struct SwiftUIView: View { @State var date = Date(