この中の
Section(header: Text("青梅市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<oumesi.count) { index in
Text(self.oumesi[index])
}
}
このText(self.oumesi[index])の部分にエラーメッセージが出てしまい、この部分を削除してみてもほかのセクションの[index]の部分にエラーが出てしまいました。原因が全くわかりません。どなたか教えていただけないでしょうか。よろしくお願いします。
struct ContentView: View {
let adatiku = ["舎人公園ドッグラン"]
let arakawaku = ["ロイヤルホームセンター南千住店ドッグラン"]
let itabasiku = ["城北中央公園ドッグラン","ドッグカフェ小豆沢","ドッグアイランド・ベルシアン"]
let edogawaku = ["篠崎公園ドッグラン"]
let ootaku = ["城南島海浜公園つばさドッグラン","羽田空港ペットホテル内ドッグラン"]
let katusikaku = ["水元公園ドッグラン"]
let koutouku = ["辰巳の森海浜公園ドッグラン","木場公園ふれあい広場ドッグラン","イオン東雲ショッピングセンタードッグラン","ららぽーと豊洲ドッグラン","綱吉の湯ドッグラン","お台場ドックリゾートドッグラン","いーの森DogGarden","JOKER's TOWN","犬のひみつきち"]
let sinagawaku = ["しおさいドッグラン"]
let sibuyaku = ["代々木公園ドッグラン","代官山ドッグガーデン"]
let sinnjyukuku = ["落合公園ドッグラン(犬の広場)","愛犬ビレッジドッグラン"]
let setagayaku = ["蘆花恒春園ドッグラン","駒沢オリンピック公園ドッグラン","KISS Wann"]
let taitouku = ["犬のしつけ教室 DOGLYドッグラン"]
let tyuuouku = ["ボヌール・デ・シアン","築地川公園わんわん広場"]
let nakanoku = ["平和の森公園ドッグラン"]
let bunnkyouku = ["目白台運動公園わんわん広場"]
let minatoku = ["芝浦公園ドッグラン"]
let meguroku = ["Andy Cafe ドッグラン","室内ドッグラン Brown"]
let akisimasi = ["カインズホーム昭島店"]
let akirunosi = ["Wonderful Nature Village","ムラウチホビー秋川店ドッグラン"]
let oumesi = ["カインズホームあきる野市","青梅"]
let koganeisi = ["小金井公園ドッグラン"]
let komaesi = ["多摩川河川敷ドッグラン"]
let tatikawasi = ["国営昭和記念公園ドッグラン"]
let tamasi = ["桜ヶ丘公園ドッグラン"]
let tyouhusi = ["神代植物公園"]
let nisitamagunn = ["みずほエコパークドッグラン"]
let hatiouzisi = ["ムラウチホビー八王子店ドッグラン","七国公園ドッグラン"]
let hinosi = ["日野市営ドッグラン"]
let hussasi = ["Wesr Dog Park","DOF SMALL GARDEN koniwan"]
let matidasi = ["カインズホーム町田多摩境店","小山内裏公園わんわん広場","野津田公園ドッグラン"]
var body: some View {
List {
VStack {
Section(header: Text("足立区").font(.largeTitle)
.padding(.top),
footer:
Text("全1件")){
ForEach(0..<adatiku.count) { index in
Text(verbatim: self.adatiku[index])
}
}
Section(header: Text("荒川区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<arakawaku.count) { index in
Text(self.arakawaku[index])
}
}
Section(header: Text("板橋区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<itabasiku.count) { index in
Text(self.itabasiku[index])
}
}
Section(header: Text("江戸川区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<edogawaku.count) { index in
Text(self.edogawaku[index])
}
}
Section(header: Text("大田区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<ootaku.count) { index in
Text(self.ootaku[index])
}
}
Section(header: Text("葛飾区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<katusikaku.count) { index in
Text(self.katusikaku[index])
}
}
Section(header: Text("江東区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<koutouku.count) { index in
Text(self.koutouku[index])
}
}
Section(header: Text("品川区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<sinagawaku.count) { index in
Text(self.sinagawaku[index])
}
}
Section(header: Text("荒川区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<sibuyaku.count) { index in
Text(self.sibuyaku[index])
}
}
Section(header: Text("新宿区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<sinnjyukuku.count) { index in
Text(self.sinnjyukuku[index])
}
}
}
VStack {
Section(header: Text("世田谷区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<setagayaku.count) { index in
Text(self.setagayaku[index])
}
}
Section(header: Text("台東区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<taitouku.count) { index in
Text(self.taitouku[index])
}
}
Section(header: Text("中央区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<tyuuouku.count) { index in
Text(self.tyuuouku[index])
}
}
Section(header: Text("中野区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<nakanoku.count) { index in
Text(self.nakanoku[index])
}
}
Section(header: Text("文京区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<bunnkyouku.count) { index in
Text(self.bunnkyouku[index])
}
}
Section(header: Text("港区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<minatoku.count) { index in
Text(self.minatoku[index])
}
}
Section(header: Text("目黒区").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<meguroku.count) { index in
Text(self.meguroku[index])
}
}
Section(header: Text("昭島市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<akisimasi.count) { index in
Text(self.akisimasi[index])
}
}
Section(header: Text("あきる野市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<akirunosi.count) { index in
Text(self.akirunosi[index])
}
}
Section(header: Text("青梅市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<oumesi.count) { index in
Text(self.oumesi[index])
}
}
}
VStack {
Section(header: Text("小金井市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<koganeisi.count) { index in
Text(self.koganeisi[index])
}
}
Section(header: Text("狛江市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<komaesi.count) { index in
Text(self.komaesi[index])
}
}
Section(header: Text("立川市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<tatikawasi.count) { index in
Text(self.tatikawasi[index])
}
}
Section(header: Text("多摩市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<tamasi.count) { index in
Text(self.tamasi[index])
}
}
Section(header: Text("調布市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<tyouhusi.count) { index in
Text(self.tyouhusi[index])
}
}
Section(header: Text("西多摩郡").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<nisitamagunn.count) { index in
Text(self.nisitamagunn[index])
}
}
Section(header: Text("八王子市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<hatiouzisi.count) { index in
Text(self.hatiouzisi[index])
}
}
Section(header: Text("日野市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<hinosi.count) { index in
Text(self.hinosi[index])
}
}
Section(header: Text("福生市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<hussasi.count) { index in
Text(self.hussasi[index])
}
}
Section(header: Text("町田市").font(.largeTitle)
.padding(.top),
footer:
Text("全件")){
ForEach(0..<matidasi.count) { index in
Text(self.matidasi[index])
}
}
}
}
.listStyle(GroupedListStyle())
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}