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

51 lines
1.0 KiB
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 {
if #available(iOS 15.0, *) {
Label("设备",systemImage: "ipad.and.iphone")
} else {
Label("设备",systemImage: "laptopcomputer.and.iphone")
}
2021-12-27 22:33:27 +08:00
}
.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
}
}