質問編集履歴

1

2021/12/01 13:55

投稿

aaaaaaaaaaaaaaw
aaaaaaaaaaaaaaw

スコア0

test CHANGED
File without changes
test CHANGED
@@ -5,151 +5,3 @@
5
5
  didSelectRowAtメソッド内のindexPath.row == 0の中にそれらを記述する必要があるかと思うのですが、
6
6
 
7
7
  方法がわかりません。
8
-
9
- ![イメージ説明](4cfe40ae31065dc5f14239d688adc71f.png)
10
-
11
-
12
-
13
- ```ここに言語を入力
14
-
15
- func numberOfSections(in tableView: UITableView) -> Int {
16
-
17
- return sections.count
18
-
19
- }
20
-
21
-
22
-
23
- func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
24
-
25
- return sections[section]
26
-
27
- }
28
-
29
-
30
-
31
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
32
-
33
- var rows = 0
34
-
35
- if section == 0 {
36
-
37
- rows = manual.count
38
-
39
- } else if section == 1 {
40
-
41
- rows = manual.count
42
-
43
- } else if section == 2 {
44
-
45
- rows = manual.count
46
-
47
- } else if section == 3 {
48
-
49
- rows = manual.count
50
-
51
- }
52
-
53
- return rows
54
-
55
- }
56
-
57
-
58
-
59
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
60
-
61
- let cell = tableView.dequeueReusableCell(withIdentifier: "settingCell", for: indexPath)
62
-
63
- var text = ""
64
-
65
- if indexPath.section == 0 {
66
-
67
- text = manual[indexPath.row]
68
-
69
- } else if indexPath.section == 1 {
70
-
71
- text = manual[indexPath.row]
72
-
73
- } else if indexPath.section == 2 {
74
-
75
- text = manual[indexPath.row]
76
-
77
- } else if indexPath.section == 3 {
78
-
79
- text = manual[indexPath.row]
80
-
81
- }
82
-
83
- cell.selectionStyle = UITableViewCell.SelectionStyle.none
84
-
85
- cell.textLabel?.text = text
86
-
87
- cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator
88
-
89
- return cell
90
-
91
- }
92
-
93
-
94
-
95
- func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
96
-
97
- if indexPath.section == 0 {
98
-
99
- if indexPath.row == 0 {
100
-
101
-
102
-
103
- } else {
104
-
105
- self.present(self.questionAlert, animated: true, completion: nil)
106
-
107
- }
108
-
109
- }
110
-
111
- if indexPath.section == 1 {
112
-
113
- if indexPath.row == 0 {
114
-
115
-
116
-
117
- } else {
118
-
119
- self.present(self.questionAlert, animated: true, completion: nil)
120
-
121
- }
122
-
123
- }
124
-
125
- if indexPath.section == 2 {
126
-
127
- if indexPath.row == 0 {
128
-
129
-
130
-
131
- } else {
132
-
133
- self.present(self.questionAlert, animated: true, completion: nil)
134
-
135
- }
136
-
137
- }
138
-
139
- if indexPath.section == 3 {
140
-
141
- if indexPath.row == 0 {
142
-
143
-
144
-
145
- } else {
146
-
147
- self.present(self.questionAlert, animated: true, completion: nil)
148
-
149
- }
150
-
151
- }
152
-
153
- }
154
-
155
- ```