Initalier Commit
This commit is contained in:
46
Linkster/ContentView.swift
Normal file
46
Linkster/ContentView.swift
Normal file
@@ -0,0 +1,46 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
@AppStorage("selectedService") private var selectedServiceRaw = StreamingService.deezer.rawValue
|
||||
|
||||
private var selectedService: Binding<StreamingService> {
|
||||
Binding(
|
||||
get: { StreamingService(rawValue: selectedServiceRaw) ?? .deezer },
|
||||
set: { selectedServiceRaw = $0.rawValue }
|
||||
)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
ZStack {
|
||||
Color("Background").ignoresSafeArea()
|
||||
|
||||
VStack(spacing: 40) {
|
||||
Image("AppLogo")
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(width: 120, height: 120)
|
||||
|
||||
Picker("Streaming-Dienst", selection: selectedService) {
|
||||
ForEach(StreamingService.allCases) { service in
|
||||
Text(service.displayName).tag(service)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
.tint(Color("Primary"))
|
||||
.padding(.horizontal, 32)
|
||||
|
||||
NavigationLink(destination: GameView(service: selectedService.wrappedValue)) {
|
||||
Text("Starten")
|
||||
.font(.system(size: 17, weight: .bold))
|
||||
.foregroundColor(.white)
|
||||
.frame(width: 220, height: 56)
|
||||
.background(Color("Primary"))
|
||||
.cornerRadius(8)
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationBarHidden(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user