I get this error when I try to create an array containing enumerated arrays.
To better illustrate the code:
let block1:Form[] = [Form.Circle, Form.Rectangle, Form.Triangle] let block2:Form[] = [Form.Rectangle, Form.Circle, Form.Triangle] let block3:Form[] = [Form.Rectangle, Form.Triangle, Form.Circle] let block4:Form[] = [Form.Circle, Form.Triangle, Form.Rectangle] let block5:Form[] = [Form.Triangle, Form.Circle, Form.Rectangle] let block6:Form[] = [Form.Triangle, Form.Rectangle, Form.Circle] var allBlocks:(Form[][])!
These are arrays containing enumerations, and the latter will contain these arrays.
override func didMoveToView(view: SKView) { allBlocks = [block1, block2, block3, block4, block5, block6]
The error occurs when I try to set the value of allBlocks
If I change the code to this, I will not get an error:
let block1:Form[] = [Form.Circle, Form.Rectangle, Form.Triangle] let block2:Form[] = [Form.Rectangle, Form.Circle, Form.Triangle] let block3:Form[] = [Form.Rectangle, Form.Triangle, Form.Circle] let block4:Form[] = [Form.Circle, Form.Triangle, Form.Rectangle] let block5:Form[] = [Form.Triangle, Form.Circle, Form.Rectangle] let block6:Form[] = [Form.Triangle, Form.Rectangle, Form.Circle] override func didMoveToView(view: SKView) { var allBlocks = [block1, block2, block3, block4, block5, block6]
But then I canβt access the allBlocks variable elsewhere.
EDIT: in case this helps
