Closed xt0fer closed 2 years ago
to be more clear, the id field and Identifiable adherence in the Forecast.Period lets you do something like
struct FutureView: View {
var forecast: Forecast
// For formatting the forecast periods.
var body: some View {
ForEach(forecast.periods) { period in
VStack(alignment: .leading){
Text("\(period.name!)")
.font(.title2)
Text("\(period.detailedForecast!)")
.font(.body)
HStack{
Text("Temp: \(period.temperature.formatted())")
Text("Wind: \(period.windSpeed.description)")
}
.font(.body.bold())
}
.padding(.bottom, 1)
}
}
}
I will review this hopefully sometime soon, thank you for the PR!
restored to orig metric unit request
wait, I should not have closed the PR.
CI is failing because Actions' secrets are not given to PRs. Tested on my own machine (simulator & macOS) and tests pass.
thank you very much, @xt0fer, for your pr. I really appreciate it!!
adding a id field and implementing Identifiable, allows the items in the Period to listed in a SwiftUI List or a ForEach iterator. Also fixed a minor bug where latitude was being sent instead of longitude,