The solution is to use contentView
instead of contentViewController
.
Use:
onboardWindow?.contentView = NSHostingView(rootView: contentView)
Instead of:
onboardWindow?.contentViewController = NSHostingController(rootView: contentView)
I don't know why it broke. If somebody knows, please let me know.