But I can't figure out how to init gridCellArr like that. So:
@State var gridCellArr = buildCellArray(theGridSize: 3) works
@State var gridCellArr = buildCellArray(theGridSize: boardSize) does not because using before init. I tried initially doing @State var gridCellArr: [Cell], and then:
init() {
gridCellArr = buildCellArray(theGridSize: _boardSize.wrappedValue)
}
but as soon as I change the value for boardSize in the picker, BOOM.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: