teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

コードが載らないため

2022/12/12 02:58

投稿

ura4
ura4

スコア14

title CHANGED
File without changes
body CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ListはNavigationLinkの中で使用しています。
4
4
 
5
+ var body: some View {
6
+ NavigationView {
7
+ List{Section(header: Text("テキスト")){ForEach(0..<self.pinned.count) {index in NavigationLink(destination: AnotherView, label: {Text(pinned[index])}}}}
8
+ }
9
+ }}
10
+
5
11
  ### 実現したいこと
6
12
 
7
13
  List内のNavigationLinkでの別Viewへの遷移

1

訂正

2022/12/12 02:56

投稿

ura4
ura4

スコア14

title CHANGED
File without changes
body CHANGED
@@ -22,11 +22,11 @@
22
22
 
23
23
  struct ContentView: View {
24
24
 
25
- @State var memos = [""]
25
+ @State var pinned = [""]
26
26
 
27
27
  var body: some View {
28
28
  NavigationView {
29
- List{Section(header: Text("テキスト")){ForEach(0..<self.memos.count) {index in NavigationLink(destination: AnotherView, label: {Text(memos[index])}}}}
29
+ List{Section(header: Text("テキスト")){ForEach(0..<self.pinned.count) {index in NavigationLink(destination: AnotherView, label: {Text(pinned[index])}}}}
30
30
  }
31
31
  }}
32
32
 
@@ -51,4 +51,4 @@
51
51
 
52
52
  ### 補足情報(FW/ツールのバージョンなど)
53
53
 
54
- Xcodeはバージョン14.1です。
54
+ Xcodeはバージョン14.1です。