Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. struct GameListView: View {
  2.  
  3. @ObservedObject var gameList: GameList = GameList()
  4. var platform: Platform = .ps4
  5.  
  6. var body: some View {
  7. NavigationView {
  8. Group {
  9. if gameList.isLoading {
  10. ProgressView()
  11. } else {
  12. List(self.gameList.games) { (game: Game) in
  13. NavigationLink(destination: GameDetailView(gameId: game.id)) {
  14. GameRowView(game: game)
  15. }
  16. }
  17. }
  18. }
  19. .navigationBarTitle(self.platform.description)
  20. }
  21. .onAppear {
  22. if self.gameList.games.isEmpty {
  23. self.gameList.reload(platform: self.platform)
  24. }
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement