teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

5

修正

2017/01/12 11:48

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -5,4 +5,8 @@
5
5
  let modalViewController = UIViewController()
6
6
  let navigationController = UINavigationController(rootViewController: modalViewController)
7
7
  present(navigationController, animated: true , completion: nil)
8
- ```
8
+ ```
9
+
10
+ `Storyboard`で遷移しているのでしたら以下の回答を参考にしてみてください。
11
+
12
+ [push遷移とmodal遷移を混在させる](https://teratail.com/questions/61344)

4

修正

2017/01/12 11:48

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -1,5 +1,5 @@
1
1
  コードで遷移しているのでしたら遷移したいところで`NavigationController`の`rootViewController`に`UIViewController`をセットするだけですよ。
2
- AppDelegatedでやっているのと同じ事です。
2
+ AppDelegateでやっているのと同じ事です。
3
3
 
4
4
  ```swift
5
5
  let modalViewController = UIViewController()

3

修正

2017/01/12 11:38

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -1,4 +1,5 @@
1
- コードで遷移しているのでしたら遷移したいところで、以下のように`NavigationController`の`rootViewController`に`UIViewController`をセットするだけですよ。
1
+ コードで遷移しているのでしたら遷移したいところで`NavigationController`の`rootViewController`に`UIViewController`をセットするだけですよ。
2
+ ※ AppDelegatedでやっているのと同じ事です。
2
3
 
3
4
  ```swift
4
5
  let modalViewController = UIViewController()

2

s

2017/01/12 11:38

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
File without changes

1

修正

2017/01/12 11:37

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -1,4 +1,4 @@
1
- コードで遷移しているのでしたら以下のように`NavigationController`の`rootViewController`に`UIViewController`をセットするだけですよ。
1
+ コードで遷移しているのでしたら遷移したいところで、以下のように`NavigationController`の`rootViewController`に`UIViewController`をセットするだけですよ。
2
2
 
3
3
  ```swift
4
4
  let modalViewController = UIViewController()