There is a collection in it two cells are customized in different ways. In one cell there is a button by pressing which the text of the label of another cell should change. Why then when I press the button nothing changes?
class cell1:UICollectionViewCell{ //button button.addTarget(self, action: #selector(handleChangeDate), for: .touchUpInside) func handleChangeDate(){ cell2.changeLabel() } } class cell2:UICollectionViewCell{ //label func changeLabel(){ self.label.text = "123" } }
Class BaseCell : UICollectionViewCell{ //button //label1 //label2 //foo() {download data} //foo2() {change label1 and Label2 text} //button.addTarget(self, action: #selector(foo2), for: .touchUpInside) } class Cell1 : BaseCell { addSubView(label1) addSubView(button) } class Cell2 : BaseCell { addSubView(label1) }- maxim rad