Using the following DatePicker code, dates are displayed with two different formats, either MMM, D YY or M/D/YY. It should always display MMM, D YY, but randomly displays M/D/YY after changing the date via the calendar interface.
import SwiftUI
struct ContentView: View {
@State var date = Date()
var body: some View {
DatePicker(
"On Date",
selection: $date,
displayedComponents: .date)
.datePickerStyle(CompactDatePickerStyle())
}
}
Post
Replies
Boosts
Views
Activity
I need to define a generic SwiftUI view that can accept sectioned fetch results for different CoreData entities, but I'm not sure how to define the generic view.
In the example below, I have two sectioned fetch results defined for Patient and Doctor entities. I need to be able to pass them to the generic view.
@SectionedFetchRequest(
sectionIdentifier: \.sectionTitle,
sortDescriptors: Patient.nameSortDescriptors(), animation: .default)
private var patients: SectionedFetchResults<String, Patient>
@SectionedFetchRequest(
sectionIdentifier: \.sectionTitle,
sortDescriptors: Doctor.nameSortDescriptors(), animation: .default)
private var doctors: SectionedFetchResults<String, Doctor>
GenericView(items: patients)
GenericView(items: doctors)
struct GenericView: View {
let items: ?????
}
I'm trying to use the SF symbol named "app-store-circle" in an app created with SwiftUI. It does not display. All other SF symbols work fine.
Is there some kind of restriction on the use of the App Store icons?
Image(systemName: "app-store-circle")
Xcode Version 14.3 (14E222b)
iOS iPhone 14 Pro Max simulator