I can open multiple windows using a loop. Now I want to open these windows one by one. That means when I close one window the next window will be opened, I mean till the close of the first window next window should not be opened. Using below code all windows are getting opened at a time.
let selectedFiles = ["file1","file2"]
for eachfile in selectedFiles
{
let storyBoard : NSStoryboard = NSStoryboard(name: "Main", bundle:nil)
let newViewController = storyBoard.instantiateController(withIdentifier: "MainView") as? ViewController
if newViewController != nil
{
newViewController.ParentView = self
self.presentAsModalWindow(newViewController!)
}
}
I want the second window to open only after closing first window