Reputation: 1
func addButtonConstraints(buttons:UIButton, mainView:UIView) {
for(index, buttons) in buttons.enumerate{
but xcode give me this error --->Value of type 'UIButton' has no member 'enumerate'
Upvotes: 0
Views: 950
Reputation: 16341
The enumerate
property is a member of Array
. So here there is only one UIButton
it can't be enumerated unless it is [UIButton]
.
Replace:
func addButtonConstraints(buttons:UIButton, mainView:UIView) {
for(index, buttons) in buttons.enumerate{
With:
func addButtonConstraints(buttons: [UIButton], mainView: UIView) {
for (index, button) in buttons.enumerated() {
Upvotes: 1