28 lines
478 B
Swift
28 lines
478 B
Swift
//
|
|
// MainView.swift
|
|
// SodaLive
|
|
//
|
|
// Created by klaus on 2023/08/09.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct MainView: View {
|
|
|
|
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
|
|
|
|
var body: some View {
|
|
if token.count > 0 {
|
|
HomeView()
|
|
} else {
|
|
LoginView()
|
|
}
|
|
}
|
|
}
|
|
|
|
struct MainView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
MainView()
|
|
}
|
|
}
|