質問編集履歴

4

修正

2018/05/17 02:27

投稿

po_tato
po_tato

スコア97

test CHANGED
File without changes
test CHANGED
@@ -46,7 +46,7 @@
46
46
 
47
47
  if status[indexPath.row] == 0 {
48
48
 
49
-
49
+ print("アイウエオ")
50
50
 
51
51
  let alertController = UIAlertController(title: "", message: "遷移しますか?", preferredStyle: UIAlertControllerStyle.alert)
52
52
 
@@ -94,6 +94,8 @@
94
94
 
95
95
  }else{
96
96
 
97
+      print("カキクケコ")
98
+
97
99
  //ここから追加部分
98
100
 
99
101
       self.appDelegate.id = self.user_id[indexPath.row]

3

修正

2018/05/17 02:26

投稿

po_tato
po_tato

スコア97

test CHANGED
File without changes
test CHANGED
@@ -92,7 +92,7 @@
92
92
 
93
93
  self.present(alertController, animated: true, completion: nil)//ここの行
94
94
 
95
- }
95
+ }else{
96
96
 
97
97
  //ここから追加部分
98
98
 
@@ -108,6 +108,8 @@
108
108
 
109
109
  self.navigationController?.pushViewController(lp, animated: true)
110
110
 
111
+ }
112
+
111
113
  }
112
114
 
113
115
 

2

本文追記

2018/05/17 02:13

投稿

po_tato
po_tato

スコア97

test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  ソースを下記に記載します。
18
18
 
19
- 最後の行をこのように変えると良いというのを海外のサイトで目にしたので試しましたが、
19
+ コメントアウト部分"ここの"をこのように変えると良いというのを海外のサイトで目にしたので試しましたが、
20
20
 
21
21
  アラートが出ずに、次の画面に遷移していまいそこで落ちてしまいます。
22
22
 
@@ -56,6 +56,10 @@
56
56
 
57
57
 
58
58
 
59
+ self.appDelegate.id = self.user_id[indexPath.row] //この行追加
60
+
61
+
62
+
59
63
  let storyboard:UIStoryboard = self.storyboard!
60
64
 
61
65
  let lp = storyboard.instantiateViewController(withIdentifier: "second") as! SecondViewController
@@ -86,9 +90,23 @@
86
90
 
87
91
 
88
92
 
89
- self.present(alertController, animated: true, completion: nil)//最後の行
93
+ self.present(alertController, animated: true, completion: nil)//ここの行
90
94
 
91
95
  }
96
+
97
+ //ここから追加部分
98
+
99
+      self.appDelegate.id = self.user_id[indexPath.row]
100
+
101
+
102
+
103
+ let storyboard:UIStoryboard = self.storyboard!
104
+
105
+ let lp = storyboard.instantiateViewController(withIdentifier: "second") as! SecondViewController
106
+
107
+ lp.modalTransitionStyle = UIModalTransitionStyle.partialCurl
108
+
109
+ self.navigationController?.pushViewController(lp, animated: true)
92
110
 
93
111
  }
94
112
 

1

コード修正

2018/05/17 01:37

投稿

po_tato
po_tato

スコア97

test CHANGED
File without changes
test CHANGED
@@ -38,9 +38,9 @@
38
38
 
39
39
  ```
40
40
 
41
- {
42
41
 
43
42
 
43
+ func tableView(_ table: UITableView, didSelectRowAt indexPath: IndexPath) {
44
44
 
45
45
 
46
46
 
@@ -92,4 +92,6 @@
92
92
 
93
93
  }
94
94
 
95
+
96
+
95
97
  ```