回答編集履歴
2
修正
test
CHANGED
@@ -208,7 +208,9 @@
|
|
208
208
|
|
209
209
|
//DestinationViewControllerのメンバに値を渡します。
|
210
210
|
|
211
|
-
//
|
211
|
+
//ここでpickerViewで選択したrowを渡したほうが変な挙動になりにくいという私見があるので
|
212
|
+
|
213
|
+
//こちらを採用しています。
|
212
214
|
|
213
215
|
let selectedRow = pickerView.selectedRow(inComponent: 0)
|
214
216
|
|
1
追記
test
CHANGED
@@ -208,10 +208,12 @@
|
|
208
208
|
|
209
209
|
//DestinationViewControllerのメンバに値を渡します。
|
210
210
|
|
211
|
-
|
211
|
+
//func pickerView(_, didSelectRow, inComponent)を使うよりは下記のように
|
212
212
|
|
213
213
|
let selectedRow = pickerView.selectedRow(inComponent: 0)
|
214
214
|
|
215
|
+
|
216
|
+
|
215
217
|
if let destination = segue.destination as? DestinationViewController {
|
216
218
|
|
217
219
|
destination.labelText = character[selectedRow]
|