All basic views now done.

Some tidying of views will be needed.
Next, data fetching needs to be worked on.

Signed-off-by: Louis Hollingworth <louis@hollingworth.ch>
This commit is contained in:
Louis Hollingworth 2023-05-23 18:37:04 +01:00
parent a18f485502
commit 058cf52926
Signed by: lucxjo
GPG key ID: A11415CB3DC7809B
6 changed files with 167 additions and 25 deletions

View file

@ -18,7 +18,21 @@ struct ContentView: View {
NavigationView {
List {
ForEach(feeds) { item in
Text(item.name!)
NavigationLink {
FeedView(source: item)
} label: {
HStack {
if Genre(rawValue: item.genre) == .news {
Image(systemName: "newspaper")
} else if Genre(rawValue: item.genre) == .technology {
Image(systemName: "laptopcomputer")
} else {
Image(systemName: "doc")
}
Text(item.name!)
}
}
}
.onDelete(perform: deleteItems)
}
@ -56,5 +70,6 @@ struct ContentView: View {
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
.environment(\.managedObjectContext, DataController.preview.container.viewContext)
}
}