I'm working on an app in SwiftUI, Xcode 12.4 / iOS14.
In one view I need to produce a list - but the data for the list is subject to an if / else condition - if a condition is met then the item should be omitted from the list. This works - but the list now has gaps in it from where items have been omitted.
Question is - is there a way to produce a list and omit the gaps or would I need to rebuild a new set of data using the if / else condition and then pass that to the list to avoid gaps ?
In one view I need to produce a list - but the data for the list is subject to an if / else condition - if a condition is met then the item should be omitted from the list. This works - but the list now has gaps in it from where items have been omitted.
Question is - is there a way to produce a list and omit the gaps or would I need to rebuild a new set of data using the if / else condition and then pass that to the list to avoid gaps ?