Im trying to implement swiftUI list item with different type of image, text, and icon in the list.
I can simply create static list and use List modifiers to list out all items in the view. But, I want behavior to be different here. In other words, row will be fully dynamic. I can modify row size or hide/unhide text or change icon based on dynamic condition.
I thought to implement by using Hstack and Vstack but it become cumbersome when we have 50 rows in single scroll view list. Is there any way to dynamic create row and change row content based on conditions ?
Thanks
2
Answers
Yes you can create an enum using that enum you can set the conditions in row to achieve the dynamic row.
Should use
ScrollView
orTabView
instead of simply putting everything in aHStack
orVStack
. And to make things dynamic check out property wrappers especially State and Binding.