Home>

When transition from screen A to screen B
whose view is not in the window hierarchy
Will be displayed after the transition.

I made the corrections described here here The warning will not disappear.
What is the cause?
Thanks for your reply.

Error message

*** is the project name.

*** [2511: 482344] Warning: Attempt to present<***. BViewController: 0x104a2a010>on<***. ViewController: 0x104c09870>whose view is not in the window hierarchy!</code ></pre>
<strong>Applicable source code</strong>
<p>Screen A</p>
<pre><code data-language = "Swift">import UIKit
class ViewController: UIViewController, UITextFieldDelegate {
    @IBOutlet weak var t1: UITextField!
    override func viewDidLoad () {
        super.viewDidLoad ()
        // Do any additional setup after loading the view.
    }
    override func viewDidAppear (_ animated: Bool) {
        super.viewDidAppear (animated)
        t1.delegate = self
        t1.keyboardType = .URL
    }

    // --- Keyboard close process ---

    // To screen B
    @IBAction func goNext (_ sender: UIButton) {
        performSegue (withIdentifier: "toB", sender: nil)
    }
    // Pass the entered text to the next screen
    override func prepare (for segue: UIStoryboardSegue, sender: Any?) {
        if segue.identifier == "toB" {
            let bView = segue.destination as! BViewController
            bView.t1 = t1.text!
        }
    }
}


Screen B

import UIKit
class BViewController: UIViewController {
    var t1 = ""
    override func viewDidLoad () {
        super.viewDidLoad ()
        // Do any additional setup after loading the view.
    }
    // --- Do the necessary processing below ---
}
Supplemental information (FW/tool version etc.)

Version
Xcode 11.1, Swift 5.0.1