我正在尝试使用集合视图委托来更新主视图上的UILabel。但是,一旦标签更新,它就会更新整个视图,这意味着它会返回到屏幕的开头 - 动画之前。是否可以只更新monthLabel而不是更新所有内容?
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell2 = CollectionView.dequeueReusableCellWithReuseIdentifier("CollectionCell", forIndexPath: indexPath) as! BookingDateCollectionCellClass
let later = getDate(indexPath.row + 5).day
print(later)
let date: String = String(later)
print(date)
cell2.dateLabel.text = date
let day = getDateData(indexPath.row + 5).dayOfWeek()
print(day)
cell2.dayLabel.text = dayShortFromNumber(day!)
self.monthlabel.text = monthFromNumber(getDate(indexPath.row + 5).month)
return cell2
}