回答編集履歴
2
コメントの消し忘れ
answer
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
```Swift
|
2
|
-
//Pushで遷移する場合
|
3
2
|
let next = storyboard?.instantiateController(withIdentifier: "ViewController2")
|
4
3
|
self.presentViewControllerAsModalWindow(next! as! NSViewController)
|
5
4
|
```
|
1
OSXアプリ
answer
CHANGED
@@ -1,18 +1,5 @@
|
|
1
1
|
```Swift
|
2
2
|
//Pushで遷移する場合
|
3
|
-
let
|
3
|
+
let next = storyboard?.instantiateController(withIdentifier: "ViewController2")
|
4
|
-
|
4
|
+
self.presentViewControllerAsModalWindow(next! as! NSViewController)
|
5
|
-
|
6
|
-
//Pushで遷移する場合(変数を渡したい時)
|
7
|
-
let nextWindow = storyboard?.instantiateViewController(withIdentifier: "次のウィンドウのIdentifier") as! /* 次のウィンドウのクラス */
|
8
|
-
/* ここで値を渡したり */
|
9
|
-
navigationController?.pushViewController(nextWindow, animated: true)
|
10
|
-
```
|
5
|
+
```
|
11
|
-
|
12
|
-
```Swift
|
13
|
-
//Modalの場合
|
14
|
-
let nextWindow = storyboard?.instantiateViewController(withIdentifier: "次のウィンドウのIdentifier")
|
15
|
-
present(nextWindow!, animated: true, completion: nil)
|
16
|
-
```
|
17
|
-
|
18
|
-
やりたいことはこれであっていますかね?
|