質問編集履歴
1
情報の追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
### 該当のソースコード
|
13
|
+
### 該当のソースコード(ViewController)
|
14
14
|
|
15
15
|
|
16
16
|
|
@@ -98,12 +98,184 @@
|
|
98
98
|
|
99
99
|
|
100
100
|
|
101
|
+
### 該当のソースコード(healthViewController)
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
```Swift
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
class healthViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
@IBOutlet weak var healthTableView : UITableView!
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
var healthNumber1 = [Double]()
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
var heinetuDate = [Double]()
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
var numberRow : Double = 0.0
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
var heinetuRow : Double = 0.0
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
var healthNum : Double = 0.0
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
var heinetuNum : Double = 0.0
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
override func viewDidLoad() {
|
144
|
+
|
145
|
+
super.viewDidLoad()
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
if UserDefaults.standard.object(forKey: "HealthNumber1") != nil {
|
152
|
+
|
153
|
+
let numbers = UserDefaults.standard.object(forKey: "HealthNumber1") as! [Double]
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
healthNum = numbers[Int(Double(numberRow))]
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
}
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
if UserDefaults.standard.object(forKey: "HeinetuDate") != nil {
|
166
|
+
|
167
|
+
let heinetuNumber = UserDefaults.standard.object(forKey: "HeinetuDate") as! [Double]
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
heinetuNum = heinetuNumber[Int(Double(heinetuRow))]
|
172
|
+
|
173
|
+
}
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
if #available(iOS 13.0, *) {
|
178
|
+
|
179
|
+
self.overrideUserInterfaceStyle = .light
|
180
|
+
|
181
|
+
} else {
|
182
|
+
|
183
|
+
// Fallback on earlier versions
|
184
|
+
|
185
|
+
}
|
186
|
+
|
187
|
+
}
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
override func viewDidAppear(_ animated: Bool) {
|
196
|
+
|
197
|
+
super.viewDidAppear(animated)
|
198
|
+
|
199
|
+
}
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
206
|
+
|
207
|
+
return 1
|
208
|
+
|
209
|
+
}
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
//変数を作る
|
218
|
+
|
219
|
+
let cell = tableView.dequeueReusableCell(withIdentifier: "HealthTableViewCell") as! healthTableViewCell
|
220
|
+
|
221
|
+
//変数の中身を作る
|
222
|
+
|
223
|
+
if healthNum < heinetuNum + 3.9 {
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
cell.healthImage.image = UIImage(named: "Group36")
|
228
|
+
|
229
|
+
}
|
230
|
+
|
231
|
+
if healthNum > heinetuNum + 4.0 {
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
cell.healthImage.image = UIImage(named: "Group37")
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
if healthNum > heinetuNum + 9.0 {
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
cell.healthImage.image = UIImage(named: "Group48")
|
244
|
+
|
245
|
+
}
|
246
|
+
|
247
|
+
if healthNum > heinetuNum + 14.0 {
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
cell.healthImage.image = UIImage(named: "Group38")
|
252
|
+
|
253
|
+
}
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
return cell
|
258
|
+
|
259
|
+
}
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
```
|
268
|
+
|
269
|
+
|
270
|
+
|
101
271
|
### 試したこと
|
102
272
|
|
103
273
|
|
104
274
|
|
105
275
|
prepareforsegueで遷移を試しましたが、このコードが作動していないみたいです。
|
106
276
|
|
277
|
+
追記)ブレークポイントを使ってsimulatorで動作確認をし、作動していないと判断しました。
|
278
|
+
|
107
279
|
|
108
280
|
|
109
281
|
### 補足情報(FW/ツールのバージョンなど)
|