質問編集履歴
1
ご指摘を頂きコードのMarkdownを修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,37 +42,31 @@
|
|
42
42
|
|
43
43
|
class SharedData {
|
44
44
|
|
45
|
-
|
45
|
+
private static let sharedDataSingleton = SharedData()
|
46
|
-
|
46
|
+
|
47
|
-
|
47
|
+
var id = 0
|
48
|
-
|
48
|
+
|
49
|
-
|
49
|
+
var jikokuShuruiSeg = 0
|
50
|
-
|
50
|
+
|
51
|
-
|
51
|
+
var youbiSeg = 0
|
52
|
-
|
52
|
+
|
53
|
-
|
53
|
+
var oufukuSeg = 0
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
|
57
|
-
|
55
|
+
var textEkimei = ""
|
58
|
-
|
56
|
+
|
59
|
-
|
57
|
+
var textHoumen = ""
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
|
63
|
-
|
59
|
+
var textURL = ""
|
64
|
-
|
65
|
-
|
66
|
-
|
60
|
+
|
67
|
-
|
61
|
+
var jikokuHyouImage: Data?
|
68
|
-
|
69
|
-
|
70
|
-
|
62
|
+
|
71
|
-
|
63
|
+
var category = 0
|
64
|
+
|
65
|
+
|
72
66
|
|
73
67
|
class func sharedObject() -> SharedData{
|
74
68
|
|
75
|
-
|
69
|
+
return SharedData.sharedDataSingleton
|
76
70
|
|
77
71
|
}
|
78
72
|
|
@@ -112,9 +106,7 @@
|
|
112
106
|
|
113
107
|
case other
|
114
108
|
|
115
|
-
}
|
109
|
+
}
|
116
|
-
|
117
|
-
|
118
110
|
|
119
111
|
}
|
120
112
|
|
@@ -148,25 +140,21 @@
|
|
148
140
|
|
149
141
|
|
150
142
|
|
151
|
-
|
143
|
+
override func viewDidLoad() {
|
152
|
-
|
144
|
+
|
153
|
-
|
145
|
+
super.viewDidLoad()
|
154
146
|
|
155
147
|
|
156
148
|
|
157
|
-
|
149
|
+
textEkimei.delegate = self as UITextFieldDelegate
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
150
|
+
|
151
|
+
|
152
|
+
|
163
|
-
|
153
|
+
//ウエブサイトGoogleのボタンが押されたときのデータの隣への移送と画面遷移
|
164
|
-
|
154
|
+
|
165
|
-
|
155
|
+
@IBAction func webSiteGoogle(_ sender: Any) {
|
166
|
-
|
167
|
-
|
168
|
-
|
156
|
+
|
169
|
-
|
157
|
+
print("ここまできたwebSiteGoogleボタンが押された")
|
170
158
|
|
171
159
|
|
172
160
|
|
@@ -178,23 +166,21 @@
|
|
178
166
|
|
179
167
|
//segmented controlの選択数値を取得
|
180
168
|
|
181
|
-
|
169
|
+
sharedData.jikokuShuruiSeg = jikokuShuruiSeg.selectedSegmentIndex
|
182
|
-
|
183
|
-
|
184
170
|
|
185
171
|
sharedData.youbiSeg = youbiSeg.selectedSegmentIndex
|
186
172
|
|
187
|
-
|
188
|
-
|
189
173
|
sharedData.oufukuSeg = oufukuSeg.selectedSegmentIndex
|
190
174
|
|
175
|
+
|
176
|
+
|
191
177
|
//テキストフィールドの名前を取得
|
192
178
|
|
193
179
|
sharedData.textEkimei = self.textEkimei.text!
|
194
180
|
|
195
181
|
sharedData.textHoumen = self.textHoumen.text!
|
196
182
|
|
197
|
-
|
183
|
+
print("ここまで来たデータの読み込み", sharedData)
|
198
184
|
|
199
185
|
|
200
186
|
|
@@ -204,13 +190,11 @@
|
|
204
190
|
|
205
191
|
//Navigation Controllerを使ってコードで遷移するコード
|
206
192
|
|
207
|
-
|
193
|
+
navigationController?.pushViewController(webSiteGoogle, animated: true)
|
208
|
-
|
194
|
+
|
209
|
-
|
195
|
+
print("ここまできたwebSiteGoogle画面への遷移")
|
210
|
-
|
211
|
-
|
212
|
-
|
196
|
+
|
213
|
-
|
197
|
+
}
|
214
198
|
|
215
199
|
|
216
200
|
|
@@ -218,6 +202,8 @@
|
|
218
202
|
|
219
203
|
### 上記のGoogleボタンにより遷移する画面(segmented controlの選択結果を表示する画面TorikomiWebViewController.swift)のコードは下記のとおりです。
|
220
204
|
|
205
|
+
|
206
|
+
|
221
207
|
```
|
222
208
|
|
223
209
|
import Foundation
|
@@ -236,47 +222,37 @@
|
|
236
222
|
|
237
223
|
|
238
224
|
|
239
|
-
|
225
|
+
@IBOutlet weak var jikokuShuruiSeg: UISegmentedControl!
|
240
|
-
|
226
|
+
|
241
|
-
|
227
|
+
@IBOutlet weak var youbiSeg: UISegmentedControl!
|
242
|
-
|
228
|
+
|
243
|
-
|
229
|
+
@IBOutlet weak var oufukuSeg: UISegmentedControl!
|
244
|
-
|
230
|
+
|
245
|
-
|
231
|
+
@IBOutlet weak var navBar: UINavigationBar!
|
246
|
-
|
247
|
-
|
248
|
-
|
232
|
+
|
249
|
-
|
233
|
+
@IBOutlet weak var webEkimei: UILabel!
|
250
|
-
|
251
|
-
|
252
|
-
|
234
|
+
|
253
|
-
|
235
|
+
@IBOutlet weak var webHoumen: UILabel!
|
254
|
-
|
255
|
-
|
256
|
-
|
236
|
+
|
257
|
-
|
237
|
+
@IBOutlet weak var webYoubi: UILabel!
|
258
|
-
|
259
|
-
|
260
|
-
|
238
|
+
|
261
|
-
|
239
|
+
@IBOutlet weak var webOuFuku: UILabel!
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
240
|
+
|
241
|
+
|
242
|
+
|
267
|
-
|
243
|
+
var webView: WKWebView!
|
268
|
-
|
244
|
+
|
269
|
-
|
245
|
+
let firstViewUrl = "https://google.com"
|
270
246
|
|
271
247
|
|
272
248
|
|
273
|
-
|
249
|
+
override func viewDidLoad() {
|
274
|
-
|
250
|
+
|
275
|
-
|
251
|
+
super.viewDidLoad()
|
276
|
-
|
277
|
-
|
252
|
+
|
278
|
-
|
253
|
+
|
254
|
+
|
279
|
-
|
255
|
+
print("ここまで来たうウェブ画面での保存データ", sharedData)
|
280
256
|
|
281
257
|
|
282
258
|
|
@@ -288,21 +264,27 @@
|
|
288
264
|
|
289
265
|
|
290
266
|
|
291
|
-
|
267
|
+
case .realBus:
|
292
|
-
|
268
|
+
|
293
|
-
|
269
|
+
self.title = "リアルタイムバス時刻表"
|
294
|
-
|
270
|
+
|
271
|
+
|
272
|
+
|
295
|
-
|
273
|
+
case .busTime:
|
296
|
-
|
274
|
+
|
297
|
-
|
275
|
+
self.title = "バスストップ時刻表"
|
298
|
-
|
276
|
+
|
277
|
+
|
278
|
+
|
299
|
-
|
279
|
+
case .railTime:
|
300
|
-
|
280
|
+
|
301
|
-
|
281
|
+
self.title = "鉄道時刻表"
|
302
|
-
|
282
|
+
|
283
|
+
|
284
|
+
|
303
|
-
|
285
|
+
case .otherTime:
|
304
|
-
|
286
|
+
|
305
|
-
|
287
|
+
self.title = "その他時刻表"
|
306
288
|
|
307
289
|
}
|
308
290
|
|
@@ -310,17 +292,15 @@
|
|
310
292
|
|
311
293
|
//Labelに駅名を表示
|
312
294
|
|
313
|
-
|
295
|
+
webEkimei.text = sharedData.textEkimei
|
314
296
|
|
315
297
|
//Labelに方面を表示
|
316
298
|
|
317
|
-
|
299
|
+
webHoumen.text = sharedData.textHoumen
|
318
|
-
|
319
|
-
|
320
|
-
|
300
|
+
|
301
|
+
|
302
|
+
|
321
|
-
//ラベルに曜日を記載
|
303
|
+
//ラベルに曜日を記載
|
322
|
-
|
323
|
-
|
324
304
|
|
325
305
|
switch JikokuDataYoubiSeg(rawValue: sharedData.youbiSeg)! {//ここにエラーUse of unresolved identifier 'JikokuDataYoubiSeg'
|
326
306
|
|
@@ -330,14 +310,20 @@
|
|
330
310
|
|
331
311
|
webYoubi.text = "日曜日"
|
332
312
|
|
313
|
+
|
314
|
+
|
333
315
|
case .saturday:
|
334
316
|
|
335
317
|
webYoubi.text = "土曜日"
|
336
318
|
|
319
|
+
|
320
|
+
|
337
321
|
case .sunSatday:
|
338
322
|
|
339
323
|
webYoubi.text = "日・土曜"
|
340
324
|
|
325
|
+
|
326
|
+
|
341
327
|
case .monFriday:
|
342
328
|
|
343
329
|
webYoubi.text = "月ー金曜"
|
@@ -358,19 +344,31 @@
|
|
358
344
|
|
359
345
|
webOuFuku.text = "往路"
|
360
346
|
|
347
|
+
|
348
|
+
|
361
349
|
case .fukuro:
|
362
350
|
|
363
351
|
webOuFuku.text = "復路"
|
364
352
|
|
353
|
+
|
354
|
+
|
365
355
|
case .other:
|
366
356
|
|
367
357
|
webOuFuku.text = "その他"
|
368
358
|
|
359
|
+
}
|
360
|
+
|
369
|
-
|
361
|
+
```
|
370
|
-
|
371
|
-
|
372
|
-
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
373
|
-
### 狙っている設定画面のスクリーンショット
|
371
|
+
### 狙っている設定画面のスクリーンショット
|
374
372
|
|
375
373
|
![イメージ説明](1ed9d53dc64272dcaae17ea3724bc55a.png)
|
376
374
|
|
@@ -396,6 +394,8 @@
|
|
396
394
|
|
397
395
|
Swift4
|
398
396
|
|
397
|
+
|
398
|
+
|
399
399
|
BBB
|
400
400
|
|
401
401
|
この問題箇所は時刻表を取得する画面で、時刻表の種類、
|
@@ -414,6 +414,8 @@
|
|
414
414
|
|
415
415
|
使います。
|
416
416
|
|
417
|
+
|
418
|
+
|
417
419
|
CCC
|
418
420
|
|
419
421
|
本件が成功した場合、次のステップではGoogle検索結果のURLと上記選択項目とインプット項目も
|