List Selection and JSON datasource
This commit is contained in:
25
Clemens Playground/Screens/GameSelection.swift
Normal file
25
Clemens Playground/Screens/GameSelection.swift
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// GameSelection.swift
|
||||
// Clemens Playground
|
||||
//
|
||||
// Created by Maximilian Roider on 14.11.25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct GameSelection: View {
|
||||
var body: some View {
|
||||
NavigationSplitView {
|
||||
List(games) { game in
|
||||
NavigationLink {
|
||||
GameView(game)
|
||||
} label: {
|
||||
GameRow(game)
|
||||
}
|
||||
}
|
||||
.navigationTitle("Games")
|
||||
} detail: {
|
||||
Text("Select a game")
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Clemens Playground/Screens/GameView.swift
Normal file
24
Clemens Playground/Screens/GameView.swift
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// GameView.swift
|
||||
// Clemens Playground
|
||||
//
|
||||
// Created by Maximilian Roider on 14.11.25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct GameView: View {
|
||||
private let game: Game
|
||||
|
||||
init(_ game: Game) {
|
||||
self.game = game
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
// Use this for >= Xcode 26 and remove commentary in "NewWebView.swift"
|
||||
// NewWebView(game.url)
|
||||
|
||||
// Use this for < Xcode 26
|
||||
OldWebView(game.url)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user