2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Swift] NavigationControllerを継承しながらコードで画面遷移をする(初心者向け)

Last updated at Posted at 2018-12-25

[Swift] NavigationControllerを継承しながらコードで画面遷移(初心者向け)

storyboardを使わずにコードで画面遷移するコードを書いて見ました。
今回は同じstoryboard上にある違う画面に遷移する時のコードを書きます。

ViewController.swift
//同じstoryboard上にあることを宣言
let storyboard: UIStoryboard = self.storyboard!
        let second = storyboard.instantiateViewController(withIdentifier: "遷移したい画面のidentierを入れます")
        self.navigationController?.pushViewController(second, animated: true)
        

今回初めてキータに投稿して見たので、まだまだ勉強が必要だなと思いました。。。。
暖かくアドバイスしていただければ幸いです!

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?