回答編集履歴
2
修正
answer
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
すみません、私が勘違いしていました。
|
2
|
-
Storyboardを
|
1
|
+
StoryboardのUIViewControllerを指定して生成する場合は以下の様にしてください。
|
3
2
|
|
4
3
|
```swift
|
5
|
-
let timeline = storyboard?.instantiateViewControllerWithIdentifier("TimelineViewController") as
|
4
|
+
guard let timeline = storyboard?.instantiateViewControllerWithIdentifier("TimelineViewController") as? TimelineViewController else {
|
5
|
+
return
|
6
|
+
}
|
6
7
|
presentViewController(timeline, animated: true, completion: nil)
|
7
8
|
```
|
8
9
|
|
9
|
-
|
10
|
+
Storyboard側では「Custom Class」 と 「Storyboard ID」を設定してください。
|
10
11
|

|
1
修正
answer
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
すみません、私が勘違いしていました。
|
1
|
-
Storyboardの
|
2
|
+
Storyboardを呼ぶ場合は以下の様にしてください。
|
2
3
|
|
4
|
+
```swift
|
5
|
+
let timeline = storyboard?.instantiateViewControllerWithIdentifier("TimelineViewController") as! TimelineViewController
|
6
|
+
presentViewController(timeline, animated: true, completion: nil)
|
7
|
+
```
|
8
|
+
|
9
|
+
そしてStoryboard IDを設定してください。
|
3
|
-

|