DatePicker in SwiftUI no longer works (invalid size)

Viewed 68

I've got a simple date picker but since Xcode 14 it no longer works.

@State private var current_date = Date()

DatePicker("Date", selection: $current_date, displayedComponents: .date)
                            .datePickerStyle(.compact)

When I open the picker, I can select a day/month fine, but if I want to change the year, tapping the top-left part of the picker I get an error in Xcode:

-[UIPickerView setFrame:]: invalid size {320, 216} pinned to {320, 216}

I get the same error if I try and set the datepickerstyle to .wheel but this time it errors as soon as the screen appears.

Is it me doing something wrong or is this a bug to report to Apple?

0 Answers
Related