クラスのサブクラスであるクラスファイルがありますUICollectionViewController
。私のcellForItemAtIndexPath
方法でtextLabel
は、セルの を設定しようとしています。ただし、textLabel
補完にはオプションがありません。これまでの方法は次のとおりです。
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as UICollectionViewCell
// Configure the cell
cell.backgroundColor = cellColor ? UIColor.blueColor() : UIColor.orangeColor()
//cell.textLabel.text = "Text"???
switch indexPath.item {
case 0...5:
cellColor = true
case 6...13:
cellColor = false
default:
cellColor = true
}
}
textLabel
をセルに追加するにはどうすればよいですか?