I am having trouble getting the date format to work.
Code in the book…
Form {
Section(
header:
Text(today.formatted(as: “MMM d”))
ERROR → Argument passed to call that takes no arguments.
.font(.headline)) {
// Section content
}
I have arrived at this version…
Form {
Section(
header:
Text(today.formatted(date: .abbreviated, time: .shortened))
.font(.headline)) {
// Section content
}
I am assuming something has changed in the current SwiftUI.
I copied and pasted the code from the Final Folder in the Downloaded code and same errors.
Xcode Version 13.1, macOS Monterey Version 12.0.1
EDIT → I worked out because I never use Starter Projects I failed to see a DateExtension.swift file.
I copied that code to my project and all works as expected…I like starting from scratch and hate the Starter Project approach.