SwiftUI DatePicker Binding optional Date, valid nil
问题 I'm experimenting code from https://alanquatermain.me/programming/swiftui/2019-11-15-CoreData-and-bindings/ my goal is to have DatePicker bind to Binding< Date? > which allow for nil value instead of initiate to Date(); this is useful, if you have Date attribute in your core data model entity which accept nil as valid value. Here is my swift playground code: extension Binding { init<T>(isNotNil source: Binding<T?>, defaultValue: T) where Value == Bool { self.init(get: { source.wrappedValue !=