Lets imagine that I have an App
var storeVM = BookStoreViewModel(bla1: bla1, bla2: bla2, bla3: bla3)
@SceneBuilder var body: some Scene {
WindowGroup {
BookStoreView( model: storeVM )
}
#if os(macOS)
Settings {
SettingsView(model: config)
}
#endif
}
BookStore have a Grid with a lot of books saved in some DB.
BookView can be initiated by a following way:
BookView(model: bookViewModel)
Target: to open BookView IN A NEW SEPARATED WINDOW(as example by click on the button). How can I do this?
Bonus question:
How can I open SettingsView(model: config)
from the code?
PS: NavigationLink
is not solution for me because I not using the NavigationView
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…