回答編集履歴
1
コードの修正
answer
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
// UIViewControllerのままだと変数にアクセスできないのでキャストします
|
20
20
|
if let firstViewController = viewController as? FirstViewController {
|
21
21
|
// 作った変数を使ってindexを取得
|
22
|
-
|
22
|
+
let index = idList.firstIndex(of: firstViewController.pageIdentifier)!
|
23
23
|
if (index > 0) {
|
24
24
|
print("before")
|
25
25
|
return storyboard!.instantiateViewController(withIdentifier: idList[index - 1])
|