Hi everyone,
I’m working on a SwiftUI project where I want the entire page to be scrollable. Within this page, I have a bottom section that displays a list of items, and these items are being rendered from a SwiftData model object. My main goal is to make this list reorderable using the onMove method.
The challenge I’m facing is that using a List inside a ScrollView requires a fixed height for the List, which doesn’t work for my use case because the content is dynamic and the height can vary. Since I’m using SwiftData to manage my data, I need a way to keep this list fully dynamic.
I’m open to using a VStack instead of a List to display the items, but I still need the reorder functionality that List provides. Does anyone know a good way to achieve this behavior? Is there a way to use onMove or similar functionality without needing a fixed height, or perhaps an alternative approach that might work better with SwiftData?
Any suggestions or insights would be greatly appreciated!
Thanks!
3
0
1.1k