Warning: beginner question.
I want to create a new instance of my app's only window by clicking on file/new in the menu bar. I assume that this requires a new instance of ViewController. Currently, file/new calls a function in AppDelegate.
@IBAction func NewWindow(_ sender: Any) {
let newVC = ViewController()
}
Because newVC is declared within the function, it should cease to exist when the function ends. If I try to declare it as a variable outside of the function, I get the error that AppDelegate doesn't support initialization. But even within the function, if I check newVC.isViewLoaded, the value returned is "false."
How do I create a new instance of the window?