Set a tag for all buttons. Then we have the property
var buttons = [UIButton]
and in your awakeFromNib init it
buttons.append[myButtonWithTag0] buttons.append[myButtonWithTag1]
Now you can access your buttons through
let button = buttons[index]
source share