I had the same problem. It resolved after adding USB under the hardware section in the Signing & Capabilities -> App Sandbox. Everything's back to normal now.
Post
Replies
Boosts
Views
Activity
This particular bug is fixed with visionOS 2.0, but now iOS 18 has introduced a variety of new problems with SwiftUI document based apps.
Same problems here. It also looks like all classes initialized stay alive when you close a document and only deinit when you open/create another document. Eventually I'm not able to open/create any documents and have to relaunch my app. Following along for updates -- not sure what to do.
My workaround for now, taking sidebar visibility into consideration.
var screenWidth: Int? = nil
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
if splitViewVisibility == .detailOnly {
screenWidth = Int(windowScene.coordinateSpace.bounds.width)
}else{
screenWidth = Int(windowScene.coordinateSpace.bounds.width) - 320
}
}