From ebe9fe45ac70d7157f8644aa1d820fd4afbd1cb8 Mon Sep 17 00:00:00 2001 From: redstrate <54911369+redstrate@users.noreply.github.com> Date: Wed, 3 Jun 2020 21:36:14 -0400 Subject: [PATCH] Add username text field --- MobileFort/MobileFort/ContentView.swift | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/MobileFort/MobileFort/ContentView.swift b/MobileFort/MobileFort/ContentView.swift index 4ba668f..9f7705a 100644 --- a/MobileFort/MobileFort/ContentView.swift +++ b/MobileFort/MobileFort/ContentView.swift @@ -1,16 +1,25 @@ import SwiftUI struct ProfileView: View { + let username: String + var body: some View { - Text("Hello, world!") + VStack { + Text("Hello, world!") + }.navigationBarTitle(username + "'s Feed") } } struct MainView: View { + @State private var username: String = "" + var body: some View { NavigationView { - NavigationLink(destination: ProfileView()) { - Text("Show Feed") + VStack { + TextField("Username", text: $username) + NavigationLink(destination: ProfileView(username: username)) { + Text("Show Feed") + } } } }