From 0a1299eb228911f50aeff0d53ef1338c23ab6d0f Mon Sep 17 00:00:00 2001 From: "Prof. H" Date: Mon, 12 Oct 2020 19:06:35 -0400 Subject: [PATCH] Some additional tweaks to starter code --- SwiftRepos/View Model/ViewModel.swift | 5 +---- SwiftRepos/Views/ContentView.swift | 11 ++++------- SwiftRepos/Views/RepositoryRow.swift | 3 ++- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/SwiftRepos/View Model/ViewModel.swift b/SwiftRepos/View Model/ViewModel.swift index 46dcc87..e72c7db 100644 --- a/SwiftRepos/View Model/ViewModel.swift +++ b/SwiftRepos/View Model/ViewModel.swift @@ -1,6 +1,6 @@ import Foundation -class ViewModel { +class ViewModel: ObservableObject { // instance of parser @@ -10,9 +10,6 @@ class ViewModel { // var filteredRepos // MARK: Methods - func update() { - - } func search(searchText: String) { diff --git a/SwiftRepos/Views/ContentView.swift b/SwiftRepos/Views/ContentView.swift index c047d3a..0aa1bca 100644 --- a/SwiftRepos/Views/ContentView.swift +++ b/SwiftRepos/Views/ContentView.swift @@ -8,13 +8,10 @@ struct ContentView: View { // @State var displayedRepos var body: some View { - return NavigationView { - VStack{ - // TextField (Search Bar) - // List - Spacer() - }.onAppear(perform: self.displayRepos) - } + + Text("Hello World!") + // replace the generic text above with a VStack as instructed + } func displayRepos() { diff --git a/SwiftRepos/Views/RepositoryRow.swift b/SwiftRepos/Views/RepositoryRow.swift index c382a6b..81dd376 100644 --- a/SwiftRepos/Views/RepositoryRow.swift +++ b/SwiftRepos/Views/RepositoryRow.swift @@ -2,6 +2,7 @@ import SwiftUI struct RepositoryRow: View { var body: some View { - // display a repository's name and decription + // display a repository's name and decription instead of generic Hello World! text + Text("Hello World!") } }