如何在UILabel和UIButton集合中引用indexPath


var index = buttons.index(of: sender)
label[index!].backgroundColor = UIColor.yellow

İ 表示我想选择 ecxept [index] [UILabel]数组中的所有元素。

你可以在不使用索引的情况下做这样的事情:

for label in labelArray {
        if (label != sender) {
            // label.setNewColor...
        }
    }

最新更新