I need to cover the day when a datepicker is chosen. I solely need to present the month and yr. i’m utilizing Swift UI
how i’m calling it
.sheet(isPresented: $showDatePickerSheet) { DatePickerSheet(selectedDate: $cardExpiry) .presentationDetents([.medium]) }
Present DatePickerSheet
`struct DatePickerSheet: View {
@Binding var selectedDate: Date
@Surroundings(.presentationMode) var presentationMode
var physique: some View {
NavigationView {
DatePicker("Choose Date", choice: $selectedDate, displayedComponents: .date)
.datePickerStyle(GraphicalDatePickerStyle())
.padding()
.navigationTitle("Choose Date")
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button("Carried out") {
presentationMode.wrappedValue.dismiss()
}
}
}
}
}
}`
How am i able to create this? Thanks upfront
I’ve tried modifying the displayed elements to one thing like yr and month nevertheless it doesn’t exist