I am working on a macOS app that presents a list of customer master records in a table view. Double-clicking a row in the table view should open a new window where the user
Additionally, to open new window, this code can help you
windowController.contentViewController = tabViewController
The full code is like that i used it in my project:
@objc func openApplicationView(_ sender: Any?) {
let mainStoryBoard = NSStoryboard(name: "Main", bundle: nil)
let tabViewController = mainStoryBoard.instantiateController(withIdentifier: "tabView") as? TabViewController
let windowController = mainStoryBoard.instantiateController(withIdentifier: "secondWindow") as! TabViewWindowController
windowController.showWindow(self)
windowController.contentViewController = tabViewController
}
It can helpful if you've closed the mainWindow. So you need to add one windowController and tabViewController(you can use normal view controller) in your own underlying storyboard.
In my side the tabViewController has been extended by NSTabViewController and tab view component has been bound with this class.
Note: I've also added the windowController in my Main.storyboard as a component and identified to use then on coding side.