Array de ouvintes de botão Swift

class ViewController: UIViewController {
    @IBOutlet weak var verticalStackView: UIStackView!

    var allButtons = [UIButton]()

    override func viewDidLoad() {
        super.viewDidLoad()

        for case let horizontalStackView as UIStackView in verticalStackView.arrangedSubviews {
            for case let button as UIButton in horizontalStackView.arrangedSubviews {
                allButtons.append(button)
            }
        }
    }
}
Grumpy Goose