Post

Replies

Boosts

Views

Activity

Reply to iOS14 SwiftUI DatePicker - How to display inline like calendar and reminders apps
.datePickerStyle() doesn't alter whether the calendar is displayed inline or modally in iOS 14. I tired that and what it changes is how the date picker display is rendered (wheel/graphical/default). Please, test it yourself in iOS 14 - I can't upload a screenshot, but in my code, the new (iOS 14 calendar style) date picker is displayed in a modal view above a blurred overlay covering the rest of the screen. In the Apple apps, it expands beneath the row.
Jun ’20
Reply to iOS14 SwiftUI DatePicker - How to display inline like calendar and reminders apps
Sure. The surrounding body looks like this:     var body: some View {         NavigationView {             Form {                 TextField("Name", text: $child.name)                 DatePicker("Date of Birth", selection: $child.dob, displayedComponents: .date)             }             .navigationBarTitle("Add Child", displayMode: .inline)             .navigationBarItems(leading: Button(action: self.onCancel) { Text("Cancel") }, trailing: Button(action: self.onSave) { Text("Save") })         }     } The view is displayed in a sheet. in iOS 13, the DatePicker expands inline when the date value is touched. in iOS 14, instead of expanding inline, it displays modally instead.
Jun ’20