1
Fork 0

Add description view

This commit is contained in:
redstrate 2020-06-04 10:00:14 -04:00
parent 7ad4b26fc6
commit f90e705dd6

View file

@ -1,5 +1,11 @@
import SwiftUI import SwiftUI
struct DescriptionView: View {
var body: some View {
Text("Hello, world!")
}
}
struct ProfileView: View { struct ProfileView: View {
let username: String let username: String
@ -10,7 +16,12 @@ struct ProfileView: View {
List(posts, id: \.post.id) { post in List(posts, id: \.post.id) { post in
PostView(post: post) PostView(post: post)
} }
}.navigationBarTitle(username + "'s Feed").onAppear { }
.navigationBarTitle(username + "'s Feed")
.navigationBarItems(trailing: NavigationLink(destination: DescriptionView()) {
Text("View Description")
})
.onAppear {
let url = URL(string: "https://www.pillowfort.social/" + self.username + "/json")! let url = URL(string: "https://www.pillowfort.social/" + self.username + "/json")!
URLSession.shared.dataTask(with: url) { (data, response, error) in URLSession.shared.dataTask(with: url) { (data, response, error) in