I try to do something like this @IBoutlet var buttons : [UIButton]
but I can't drag button to this outlet
Any idea, how can I achieve that?
I try to do something like this @IBoutlet var buttons : [UIButton]
but I can't drag button to this outlet
Any idea, how can I achieve that?
It's possible to do that.
Here is how:
-
class ViewController2: UIViewController {
@IBOutlet var collection:[UIView]!
override func viewDidLoad() {
super.viewDidLoad()
}
}
To add a button to an existing array outlet, drag the other way 'round: from the circle in the margin of the view controller to the button. (No need to hold the control key while doing this drag.)