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
}
}
Post
Replies
Boosts
Views
Activity
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.
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.