master
hua 4 years ago
parent 5a79705fa5
commit 8def448ca7
  1. 11
      Weibo/ContentView.swift
  2. 4
      Weibo/LoginView.swift

@ -19,21 +19,14 @@ struct ContentView: View {
@State var selection=2
var body: some View {
TabView(selection: self.$selection) {
if self.user.access_token==nil{
if (self.user.access_token != nil){
IndexView().tabItem { VStack {
Image("house")
Text("首页")
.foregroundColor(Color.black)
} }.tag(1).hidden()
}else{
IndexView().tabItem { VStack {
Image("house")
Text("首页")
.foregroundColor(Color.black)
} }.tag(1)
} }.tag(1)
}
LoginView().tabItem { VStack {

@ -86,12 +86,12 @@ struct UserView:View {
var body:some View{
VStack {
HStack {
ImageView(imageUrl: self.user.avatar_hd!)
ImageView(imageUrl: self.user.avatar_hd ?? "")
.frame(width: 60.0, height: 60.0)
.clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/)
VStack {
Text(self.user.name!)
Text("简介:\(self.user.desc!)")
Text("简介:\(self.user.desc ?? "")")
}
Spacer()
Button(action: {

Loading…
Cancel
Save