Mixonomer-iOS/Mixonomer/Router.swift

33 lines
675 B
Swift

//
// Router.swift
// Mixonomer
//
// Created by Andy Pack on 25/04/2020.
// Copyright © 2020 Sarsoo. All rights reserved.
//
import SwiftUI
// Root level view loaded by delegate to show either main app or login screen
struct Router: View {
@EnvironmentObject var liveUser: LiveUser
@ViewBuilder
var body: some View {
if liveUser.loggedIn {
AppSkeleton()
}
else {
LoginScreen()
}
}
}
struct Router_Previews: PreviewProvider {
static var previews: some View {
Router()
.environmentObject(LiveUser(playlists: [], tags: [], username: "user", loggedIn: false))
}
}