私はiOS開発の初心者ですが、最近は初心者向けのチュートリアルに沿っています。3つの視点コントローラの切り替え
ボタンをクリックして1つのVCから別のVCに移動したいとしましょう。そのため、1つのViewControllerから別のViewController(モーダルセグ)に移動する3つの方法があります。メインストーリーボードに
- は、私はプログラム的
@IBAction func logInButtonDidPressed(_ sender: Any) { // modal transition to VC2 let viewController2 = storyboard?.instantiateViewController(withIdentifier: "ViewController2") as! ViewController2 present(viewController2, animated: true, completion: nil) }
以下のコードを実行することによって、
programmaticaly本モーダルを先ビュー・コントローラをTH及び選択ボタンからの制御とドラッグをクリック、実行セグ関数を使用して、
@IBAction func logInButtonDidPressed(_ sender: Any) { performSegue(withIdentifier: "toSecondViewController", sender: self) }
は同じですか?異なるケースに使用されていますか?事前:)で
おかげ