48.8 Designing the Widget View
Now that the widget entry has been created and used as the basis for some sample timeline data, the widget view needs to be designed. When the widget extension was added to the project, a template widget entry view was included in the WeatherWidget.swift file which reads as follows:
struct WeatherWidgetEntryView : View {
var entry: Provider.Entry
var body: some View {
Text(entry.date, style: .time)
}
}
As currently implemented, the view is passed a widget entry from which the date value is extracted and displayed on a Text view.
Modify the view structure so that it reads as follows, keeping in mind that it will result in syntax errors appearing in the editor. These will be resolved later in the tutorial:
struct WeatherWidgetView: View {
var entry: Provider.Entry
...