func addStartingButtons2() {
let button = UIButton(frame: CGRect(x: 50, y: buttonY, width: 250, height: 30))
button.layer.cornerRadius = 10 // get some fancy pantsy rounding
button.backgroundColor = UIColor.darkGray
button.setTitle("Button for Villain: \(String(describing: hashes[button]))", for: UIControlState.normal)
buttons.append(button)
buttons.append(button)
for button in buttons {
self.view.addSubview(button)
button.frame.origin.y += 50
}
}
に追加します。 var hashes = [UIButton : [Double]]() var buttons = [UIButton]()
配列は、ビュー
は、この関数に2と同じボタン他onder 1を追加したいのですが、一つだけのボタンは