I'm just starting out with SwiftUI (for macOS) and am running into all sorts of problems, mostly related to resizing the application window.
I'm seeing two distinct crashes in my app, but I can't figure out how to troubleshoot them.
One is incredibly vague:
*** Assertion failure in -[_TtC7SwiftUIP33_A874FC5B9DB530D4375C25AE2AA39DF215HostingClipView setBoundsOrigin:], /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1894.40.150/AppKit.subproj/NSView.m:5646
this'll happen randomly when resizing the window, but there's nothing else to go on.
The other is:
It's not legal to call -layoutSubtreeIfNeeded on a view which is already being laid out. If you are implementing the view's -layout method, you can call -[super layout] instead. Break on void _NSDetectedLayoutRecursion(void) to debug. This will be logged only once. This may break in the future.
Which gives me a tip, but once I actually figured out how to set that breakpoint, I still really have no idea what to do. The stack trace for either really doesn't do me any good.
If it is still a small project, could uou post here:
- ContentView file
- Appdelegate file