I have created a SwiftUI based app, a small sidebar list left and a bigger list on the right side. The big list has thousands of elements, visible list rows are created lazily.
When I make my app the active App via Command+Tab, there is a few seconds long delay until I can use my app again. I have used Instruments Time Profiler, there a a lot calls to updateConstraints. It seems that macOS is rendering the whole SwiftUI view graph when the app gets active.
I do not understand why this is happening, views should only be rendered when my data has changed. I have set an breakpoint into my body implementations, the debugger is not called. So the drawing seems only to happen inside of Appkit.
How can I prevent this?
When I make my app the active App via Command+Tab, there is a few seconds long delay until I can use my app again. I have used Instruments Time Profiler, there a a lot calls to updateConstraints. It seems that macOS is rendering the whole SwiftUI view graph when the app gets active.
I do not understand why this is happening, views should only be rendered when my data has changed. I have set an breakpoint into my body implementations, the debugger is not called. So the drawing seems only to happen inside of Appkit.
How can I prevent this?