Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct GameListView: View {
- @ObservedObject var gameList: GameList = GameList()
- var platform: Platform = .ps4
- var body: some View {
- NavigationView {
- Group {
- if gameList.isLoading {
- ProgressView()
- } else {
- List(self.gameList.games) { (game: Game) in
- NavigationLink(destination: GameDetailView(gameId: game.id)) {
- GameRowView(game: game)
- }
- }
- }
- }
- .navigationBarTitle(self.platform.description)
- }
- .onAppear {
- if self.gameList.games.isEmpty {
- self.gameList.reload(platform: self.platform)
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement