質問編集履歴
1
コードを変えました
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,8 +1,39 @@
|
|
1
|
-
```swift3
|
2
|
-
let targetViewController = self.storyboard!.instantiateViewController( withIdentifier: "secondView" )
|
3
|
-
self.navigationController?.pushViewController(targetViewController, animated: true)
|
4
1
|
```
|
5
|
-
これで画面遷移ができると教えていただいたのですが、遷移できません。
|
6
|
-
|
2
|
+
import UIKit
|
7
3
|
|
4
|
+
class FirstViewController: UIViewController {
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
@IBAction func change(_ sender: Any) {
|
9
|
+
let storyboard: UIStoryboard = self.storyboard!
|
8
|
-
|
10
|
+
let nextView = storyboard.instantiateViewController(withIdentifier: "second")
|
11
|
+
let navi = UINavigationController(rootViewController: nextView)
|
12
|
+
// アニメーションの設定
|
13
|
+
// navi.modalTransitionStyle = .coverVertical
|
14
|
+
present(navi, animated: true, completion: nil)
|
15
|
+
}
|
16
|
+
override func viewDidLoad() {
|
17
|
+
super.viewDidLoad()
|
18
|
+
// Do any additional setup after loading the view, typically from a nib.
|
19
|
+
|
20
|
+
|
21
|
+
}
|
22
|
+
|
23
|
+
override func didReceiveMemoryWarning() {
|
24
|
+
super.didReceiveMemoryWarning()
|
25
|
+
// Dispose of any resources that can be recreated.
|
26
|
+
}
|
27
|
+
|
28
|
+
|
29
|
+
}
|
30
|
+
|
31
|
+
|
32
|
+
```
|
33
|
+
**1**
|
34
|
+

|
35
|
+
**2**
|
36
|
+

|
37
|
+
**3**
|
38
|
+

|
39
|
+
私は1から2のように、遷移後、遷移先の画面の上にナビゲーションコントローラのバーがなく、タブバーが表示された状態にしたいのですが、ナビゲーションコントローラナビゲーションコントローラを使ってやると遷移先の画面が3のようになります。2のようにするにはどうしたらいいですか?
|