The problem is that when I to the point in the app where the AddEditAssetView is displayed and I tap one of the TextField()s to start typing, then the app spins out of control and spews this over and over in the console until Xcode halts the process.
It’s not just when running the app though. When I’m doing a preview of just the AddEditAssetView, then these two lines spew infinitely in the preview console, even though AddEditAssetView doesn’t present any sheet() or fullScreenCover():
Currently, only presenting a single sheet is supported.
The next sheet will be presented when the currently presented sheet gets dismissed.
I have no idea where this bug might live and there’s too much code to include here, so I’ll break down the basic structure in pseudo-code below. If there is any bit of code that you want to see the full details on, please comment and I’ll update the post.
The RootContentView is the main menu. When they start/resume a game, it does a fullScreenCover() to show the GameView. The GameView has several tabs, one of which is the AssetsView(). The AssetsView() as a nav bar ‘add’ button to add a new Asset. That does a fullScreenCover() to show the AddEditAssetView. The AddEditAssetView has several TextFields() that are bound to properties on my SwiftData model object asset. Tapping on any TextField() causes the crash, so I’ve only included one below.
RootContentView() {
Stuff()
}
.fullScreenCover(isPresented: $showinggame, content: {
GameView()
})
GameView() {
TabView() {
AssetsView()
OtherStuff()
}
}
AssetsView() {
Button()
.fullScreenCover(isPresented: $showingaddscreen) {
AddEditAssetView()
}
}
AddEditAssetView() {
TextField("Cost", value: $asset.cost, format: .number)
}




