Tetris/TetrisUI/NextTetrominoesView.swift

33 lines
763 B
Swift

//
// NextTetrominoesView.swift
// Tetris
//
// Created by Shadowfacts on 10/16/19.
// Copyright © 2019 Shadowfacts. All rights reserved.
//
import SwiftUI
import TetrisKit
public struct NextTetromioesView: View {
let tetrominoes: [Tetromino]
public init(tetrominoes: [Tetromino]) {
self.tetrominoes = tetrominoes
}
public var body: some View {
VStack {
ForEach(0..<self.tetrominoes.count, id: \.self) { (index) in
TetrominoView(tetromino: self.tetrominoes[index]).aspectRatio(1, contentMode: .fit)
}
}
}
}
struct NextTetrominoesView_Previews: PreviewProvider {
static var previews: some View {
NextTetromioesView(tetrominoes: [.t, .l, .z])
}
}