描绘一个 tableViewCell 的图像。在一个 tableViewCell 里面有一些内容和一个 CollectionView(显示日期的灰色区域)。根据集合视图中的日期及其滚动,我必须显示年份和月份(“2018 年 12 月”:图像中是静态的)。
这是我的 JTAppleCalender cellForItemAt 方法:
func calendar(_ calendar: JTAppleCalendarView, cellForItemAt date: Date, cellState: CellState, indexPath: IndexPath) -> JTAppleCell {
let cell = calendar.dequeueReusableJTAppleCell(withReuseIdentifier: "CalenderCell", for: indexPath) as! CalenderCell
cell.lblDate.text = cellState.text
formatter.dateFormat = "EEE"
cell.lblDay.text = formatter.string(from: cellState.date)
formatter.dateFormat = "MMMM YYYY"
print(formatter.string(from: cellState.date))
formatter.dateFormat = "dd-MM-yyyy"
print(formatter.string(from: cellState.date))
if(pickup_dates .contains(formatter.string(from: cellState.date))){
let index = pickup_dates.index(of: formatter.string(from: cellState.date))
let dictinfoDelivery = self.infoDelivery.object(at: index) as! NSDictionary
cell.lblPrice.text = dictinfoDelivery .value(forKey: "total_price_format") as? String
cell.isUserInteractionEnabled = true
}
else{
cell.lblPrice.text = ""
cell.isUserInteractionEnabled = false
}
return cell
}
我正在尝试从该方法内部访问 tableView label("December 2018") 但无法这样做。如何从子 collectionViewCell 访问这个 TableViewCell 标签?我的要求是更改 tableViewCell(价格,数量)wrt 在子 CollectionView 中选择的日期中的 2-3 内容。