Interestingly, I've been toying around with exactly this kind in UIKit. Things are still a mess. I think it should be completely doable in SwiftUI, in either case it's most likely a matter of defining a set of custom methods on your nesting view's behavior correctly. I am not there yet with my UIKit implementation. But if you squint and are generous, you can see how it kind of works. I've attached a gif.
I've been surprised I couldn't find some existing work on this. I'm sure someone's done it. Searching for it led me to this post of yours.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: