** also, how do you add images to posts?
As you can see in the screenshot (the text is in Norwegian) I'm trying to create a list of tags that can be turned on/off.
I want to use a a LazyVGrid with a ForEach, because the list/grid should be able to expand as people add tags
I thought this would be a piece of cake, but it turned out to be one of the most challenging issues I've faced in learning Swift and SwiftUI, thus far.
I assumed I could create code slightly as such.
struct Tag: Hashable {
var title: String
var checked: Bool
}
then a list of [Tag]
var tagList = [ LIST OF TAGS ]
and then put that into a ForEach and iterate over this. With a button to turn toggle the Bool on/off.
Alas, no such luck. Xcode keeps telling me that it is a Let constant (I suspect that this is due to the nature of Structs)
I tried a zillion different ways, but I keep coming back to the MVVM pattern, having to create a separate View and ViewModel to contain it all.. and it just becomes this huge ordeal (and I still can't make it work)
If anyone has an elegant solution to this, then I think the community at large would be grateful