回答編集履歴

2

コード修正

2021/08/29 12:02

投稿

hoshi-takanori
hoshi-takanori

スコア7895

test CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  }
26
26
 
27
- .onDelete(perform: { data.array.remove(atOffsets: $0) })
27
+ .onDelete { data.array.remove(atOffsets: $0) }
28
28
 
29
29
  }
30
30
 

1

誤字修正

2021/08/29 12:02

投稿

hoshi-takanori
hoshi-takanori

スコア7895

test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- というわけで、[enumerated](https://developer.apple.com/documentation/swift/array/1687832-enumerated) を使うと良いでしょう。ただし、id: には .offset ではなく .element.id を渡す必要があります。
5
+ というわけで、両方使える [enumerated](https://developer.apple.com/documentation/swift/array/1687832-enumerated) を使うと良いでしょう。ただし、id: には .offset ではなく .element.id を渡す必要があります。
6
6
 
7
7
  参考: [SwiftUIのForEachでViewを繰り返し表示|TAAT|note](https://note.com/taatn0te/n/n01b6894c67a3)
8
8