pushdeer/ios/PushDeer-iOS/PushDeer/View/MainView.swift

47 lines
906 B
Swift
Raw Normal View History

2021-12-27 22:33:27 +08:00
//
// MainView.swift
// PushDeer
//
// Created by HEXT on 2021/12/25.
//
import SwiftUI
/// APP
struct MainView: View {
@EnvironmentObject private var store: AppState
2021-12-27 22:33:27 +08:00
var body: some View {
TabView.init(selection: $store.tabSelectedIndex) {
2021-12-27 22:33:27 +08:00
DeviceListView()
.tabItem {
Label("设备",systemImage: "ipad.and.iphone")
}
.tag(0)
2021-12-27 22:33:27 +08:00
KeyListView()
.tabItem{
Label("Key",systemImage: "key")
}
.tag(1)
2021-12-27 22:33:27 +08:00
MessageListView()
.tabItem({Label("消息",systemImage: "message")}).onTapGesture {
}
.tag(2)
2021-12-27 22:33:27 +08:00
SettingsView()
.tabItem{
Label("设置",systemImage: "gearshape")
}
.tag(3)
2021-12-27 22:33:27 +08:00
}
}
}
struct MainView_Previews: PreviewProvider {
static var previews: some View {
MainView().environmentObject(AppState.shared)
2021-12-27 22:33:27 +08:00
}
}