SwiftUI Splitview: persist view positions

I am creating a SwiftUI 2 app with a HSplitView. The SplitView has several subviews (sidebar - main view - detail view).

The user may resize the individual views with the normal split view behavior (dragging the divider bar).

I want to persist the user's last used view sizes, so that when the user closes the app and comes back later, the same view layout (view sizes inside the splitview) is presented.

How can/should this be achieved?

Thanks for your help.


Answered by HansKe in 640499022
Update: working in Big Sur beta 9, XCode12.2 beta 2.
Accepted Answer
Update: working in Big Sur beta 9, XCode12.2 beta 2.
SwiftUI Splitview: persist view positions
 
 
Q