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

質問編集履歴

1

コードを変えました

2017/08/10 03:22

投稿

退会済みユーザー
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
- tabbed applicationの画面遷移なのですが、自分で調べて実行したら、タブバーが消えてしまいました。消えなくするにはどうしたらいいでしょうか?
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
+ ![FirstView!](dfc6b8e76356b75bc64aa2dbe7dee263.png)
35
+ **2**
36
+ ![SecondView](ed568365e3f04b2a65d4c5833e10dd34.png)
37
+ **3**
38
+ ![navi](fd4ebf51164b9c536ec6c70056675d2c.png)
39
+ 私は1から2のように、遷移後、遷移先の画面の上にナビゲーションコントローラのバーがなく、タブバーが表示された状態にしたいのですが、ナビゲーションコントローラナビゲーションコントローラを使ってやると遷移先の画面が3のようになります。2のようにするにはどうしたらいいですか?