Skip to content

Instantly share code, notes, and snippets.

@barefeettom
Created April 7, 2021 04:02
Show Gist options
  • Save barefeettom/848c7c8ab7a3cf57706fd9e0187ff08f to your computer and use it in GitHub Desktop.
Save barefeettom/848c7c8ab7a3cf57706fd9e0187ff08f to your computer and use it in GitHub Desktop.
WeatherScene. For article: https://medium.com/p/4ddf8710d1a0/
import SwiftUI
struct WeatherScene {
@StateObject var viewModel = ViewModel()
}
extension WeatherScene: View {
var body: some View {
List {
TextField("City", text: $viewModel.city)
TextField("Country Code", text: $viewModel.countryCode)
Button("Fetch Weather") { viewModel.fetch() }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment