You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
632 B
30 lines
632 B
4 years ago
|
//
|
||
|
// ContentView.swift
|
||
|
// Weibo
|
||
|
//
|
||
|
// Created by Qihua Pan on 2020/8/16.
|
||
|
// Copyright © 2020 Qihua Pan. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import SwiftUI
|
||
|
|
||
|
|
||
|
struct ContentView: View {
|
||
|
|
||
|
@State var selection=1
|
||
|
|
||
|
|
||
|
var body: some View {
|
||
|
TabView(selection: self.$selection) {
|
||
|
IndexView().tabItem { Text("首页") }.tag(1)
|
||
|
LoginView().tabItem { Text("我") }.tag(2)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
struct ContentView_Previews: PreviewProvider {
|
||
|
static var previews: some View {
|
||
|
ContentView().environment(\.managedObjectContext, UserData.getContext()).environmentObject(UserData.getUser())
|
||
|
}
|
||
|
}
|