51.1 Modifying the Weather Data
Before adding configuration support to the widget, an additional structure needs to be added to the widget data to provide a way to associate cities with weather timelines. Add this structure by modifying the WeatherData.swift file as follows:
import Foundation
import WidgetKit
struct LocationData: Identifiable {
let city: String
let timeline: [WeatherEntry]
var id: String {
city
}
static let london = LocationData(city: "London",
timeline: londonTimeline)
...