struct StructWithArray { var arrayInStruct: [Int] init() { arrayInStruct = [Int]() } } var structs = [StructWithArray()] // playground crashes when using this line structs[0].arrayInStruct.append(3) // this works just fine let count = structs[0].arrayInStruct.count structs[0].arrayInStruct[count] = 3