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:
parent
a18f485502
commit
058cf52926
6 changed files with 167 additions and 25 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue