I need help doing something. Let me give a simple layout of what I’m doing and then I’ll explain what I need.
First off I’m using SwiftUI and Xcode 14.
I have a list with an image and a text description in HStack
In my model I have a string that indicates if my image should be small, medium or large in size, thereby changing the look of my list.
I created 3 different views depending on the size BUT I can’t figure out how to select which view to call.
I can’t use a switch or an if statement as they are not allowed in a view.
Can someone point me in the direction of how to do this? I don’t have a grasp yet on how views and conditional code can work together in SwiftUI, unless I have a button that I can attach code to.
Any help would be appreciated.
Thanks - Ed