Created
April 7, 2021 04:02
-
-
Save barefeettom/848c7c8ab7a3cf57706fd9e0187ff08f to your computer and use it in GitHub Desktop.
WeatherScene. For article: https://medium.com/p/4ddf8710d1a0/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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