回答編集履歴
1
destination
answer
CHANGED
@@ -4,4 +4,24 @@
|
|
4
4
|
tableView.deselectRow(at: indexPath, animated: false)
|
5
5
|
```
|
6
6
|
|
7
|
-
を呼んでセルの選択を解除しているようなので、`prepare(for:sender:)`の中の`self.tableView.indexPathForSelectedRow`で選択中のセルを取得できていないのではないのでしょうか?
|
7
|
+
を呼んでセルの選択を解除しているようなので、`prepare(for:sender:)`の中の`self.tableView.indexPathForSelectedRow`で選択中のセルを取得できていないのではないのでしょうか?
|
8
|
+
|
9
|
+
【追記】
|
10
|
+
|
11
|
+
```swift
|
12
|
+
if let navi = segue.destination as? UINavigationController,
|
13
|
+
//※この中に処理が来ていないのでは?
|
14
|
+
let fVC = navi.viewControllers.first as? ViewController {
|
15
|
+
fVC.data = cellData.1
|
16
|
+
fVC.received = result
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
20
|
+
上記コメント位置に処理が来ていないようであれば、下記のように書き換えて試してみて下さい。
|
21
|
+
|
22
|
+
```swift
|
23
|
+
if let vc = segue.destination as? ViewController {
|
24
|
+
vc.data = cellData.1
|
25
|
+
vc.received = result
|
26
|
+
}
|
27
|
+
```
|