The following error message was displayed
Why is this?
Value of type 'List' has no member 'navigationTitle'
struct TopList: View {
@ObservedObject var fetcher = ToplistFetcher()
var body: some View{
NavigationView{
List{
Section(header: Text("緊急連絡")){
ForEach(0..<fetcher.toplistEmergencylists.count, id: \.self){ index in
VStack(alignment: .leading){
NavigationLink(destination: SecondView(t: fetcher.toplistEmergencylists[index].title)){
VStack(alignment: .leading){
HStack{
Image(systemName: "doc.text")
.font(.subheadline)
Text(fetcher.toplistEmergencylists[index].title)
}
HStack(){
Image(systemName: "person.circle")
.font(.subheadline)
Text(fetcher.toplistEmergencylists[index].changer)
}
HStack{
Image(systemName: "calendar")
.font(.subheadline)
Text(fetcher.toplistEmergencylists[index].postdate.toStringWithCurrentLocale())
}
}
}
}
}
}
Section(header: Text("必読")){
ForEach(0..<fetcher.toplistMustlists.count, id: \.self){ index in
VStack(alignment: .leading){
NavigationLink(destination: SecondView(t: fetcher.toplistMustlists[index].title)){
VStack(alignment: .leading){
HStack{
Image(systemName: "doc.text")
.font(.subheadline)
Text(fetcher.toplistMustlists[index].title)
}
HStack(){
Image(systemName: "person.circle")
.font(.subheadline)
Text(fetcher.toplistMustlists[index].changer)
}
HStack{
Image(systemName: "calendar")
.font(.subheadline)
Text(fetcher.toplistMustlists[index].postdate.toStringWithCurrentLocale())
}
}
}
}
}
}
Section(header: Text("最近の投稿")){
ForEach(0..<fetcher.toplistRecentlists.count, id: \.self){ index in
VStack(alignment: .leading){
NavigationLink(destination: SecondView(t: fetcher.toplistRecentlists[index].title)){
VStack(alignment: .leading){
HStack{
Image(systemName: "doc.text")
.font(.subheadline)
Text(fetcher.toplistRecentlists[index].title)
}
HStack(){
Image(systemName: "person.circle")
.font(.subheadline)
Text(fetcher.toplistRecentlists[index].changer)
}
HStack{
Image(systemName: "calendar")
.font(.subheadline)
Text(fetcher.toplistRecentlists[index].postdate.toStringWithCurrentLocale())
}
}
}
}
}
}
}
.navigationTitle("掲示板TOP")
.listStyle(GroupedListStyle())
}
}
}
Selecting any option will automatically load the page