UICollectionView cell.ViewWithTag returning nil for UILabel

后端 未结 2 985
予麋鹿
予麋鹿 2021-01-25 17:49

This label seems to return nil, even though I have the reuseIdentifier and tag set properly.

override func collectionView(collectionView: UICollectionView, cell         


        
2条回答
  •  走了就别回头了
    2021-01-25 18:12

    Try removing this line from viewDidLoad:

    self.collectionView!.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: reuseIdentifier)
    

提交回复
热议问题