回答編集履歴

2

修正

2016/03/09 21:45

投稿

_Kentarou
_Kentarou

スコア8490

test CHANGED
@@ -1,12 +1,14 @@
1
- すみません、私が勘違いしていました。
2
-
3
- Storyboardを呼ぶ場合は以下の様にしてください。
1
+ StoryboardのUIViewController指定して生成する場合は以下の様にしてください。
4
2
 
5
3
 
6
4
 
7
5
  ```swift
8
6
 
9
- let timeline = storyboard?.instantiateViewControllerWithIdentifier("TimelineViewController") as! TimelineViewController
7
+ guard let timeline = storyboard?.instantiateViewControllerWithIdentifier("TimelineViewController") as? TimelineViewController else {
8
+
9
+ return
10
+
11
+ }
10
12
 
11
13
  presentViewController(timeline, animated: true, completion: nil)
12
14
 
@@ -14,6 +16,6 @@
14
16
 
15
17
 
16
18
 
17
- そしてStoryboard IDを設定してください。
19
+ Storyboard側では「Custom Class」 と 「Storyboard IDを設定してください。
18
20
 
19
21
  ![image](7f7479f416d31fd698ebabdf1edcd4a8.png)

1

修正

2016/03/09 21:45

投稿

_Kentarou
_Kentarou

スコア8490

test CHANGED
@@ -1,5 +1,19 @@
1
+ すみません、私が勘違いしていました。
2
+
1
- Storyboardの遷移先のUIViewControllerのカスタムクラスがTimelineViewControllerなっていますか?
3
+ Storyboardを呼ぶ場合は以下くださ
2
4
 
3
5
 
4
6
 
7
+ ```swift
8
+
9
+ let timeline = storyboard?.instantiateViewControllerWithIdentifier("TimelineViewController") as! TimelineViewController
10
+
11
+ presentViewController(timeline, animated: true, completion: nil)
12
+
13
+ ```
14
+
15
+
16
+
17
+ そしてStoryboard IDを設定してください。
18
+
5
- ![image](9e848f50072b36869cf4d4bb520ca15a.png)
19
+ ![image](7f7479f416d31fd698ebabdf1edcd4a8.png)