From f90e705dd65c49a7b4feabea4b8c7db902ffc4b3 Mon Sep 17 00:00:00 2001 From: redstrate <54911369+redstrate@users.noreply.github.com> Date: Thu, 4 Jun 2020 10:00:14 -0400 Subject: [PATCH] Add description view --- MobileFort/MobileFort/ProfileView.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/MobileFort/MobileFort/ProfileView.swift b/MobileFort/MobileFort/ProfileView.swift index 2801585..099360f 100644 --- a/MobileFort/MobileFort/ProfileView.swift +++ b/MobileFort/MobileFort/ProfileView.swift @@ -1,5 +1,11 @@ import SwiftUI +struct DescriptionView: View { + var body: some View { + Text("Hello, world!") + } +} + struct ProfileView: View { let username: String @@ -10,7 +16,12 @@ struct ProfileView: View { List(posts, id: \.post.id) { post in 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")! URLSession.shared.dataTask(with: url) { (data, response, error) in