回答編集履歴

2

修正

2018/08/01 06:59

投稿

xAxis
xAxis

スコア1349

test CHANGED
@@ -208,7 +208,9 @@
208
208
 
209
209
  //DestinationViewControllerのメンバに値を渡します。
210
210
 
211
- //func pickerView(_, didSelectRow, inComponent)使は下記ように 
211
+ //ここでpickerViewで選択したrowを渡したほが変な挙動になにくいという私見がある
212
+
213
+ //こちらを採用しています。
212
214
 
213
215
  let selectedRow = pickerView.selectedRow(inComponent: 0)
214
216
 

1

追記

2018/08/01 06:59

投稿

xAxis
xAxis

スコア1349

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]