-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContentView.swift
45 lines (40 loc) · 1.21 KB
/
ContentView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// ContentView.swift
// swiftui-loop-videoplayer-example
//
// Created by Igor Shelopaev on 03.07.2023.
//
import SwiftUI
struct ContentView: View {
@State public var navigationPath = NavigationPath()
var body: some View {
NavigationStack(path: $navigationPath) {
ResponsiveStack(spacing: 5) {
Spacer()
ForEach(VideoPlayerModel.data, id: \.self) { view in
NavigationLink(value: view.name) {
labelTpl(view.icon, color: view.color)
}
.accessibilityIdentifier(view.name)
}
Spacer()
}
.background(.quaternary)
.navigationDestination(for: String.self) { name in
getDestination(for: name)
}
}
.preferredColorScheme(.dark)
.onAppear{
// navigationPath = .init(["Video6"])
}
}
@ViewBuilder
private func labelTpl(_ name: String, color: Color = .blue) -> some View {
Image(systemName: name)
.font(.system(size: 68))
.padding(8)
.foregroundColor(color)
.frame(width: 102)
}
}