我在UICollection视图中创建了一个水平滚动的标签。
- 我需要通过满足某些条件来提供在运行时在该标签上显示的数据。
- 通过点击该标签,它应该从表格视图中过滤数据并将其显示在同一个表格视图中
醇>
CODE:
let xxx = ["Appointments", "Waitlisted", "Suspended", "Billing", "Cancelled", "Transfer", "Revoked", "Checkedin"]
// This dummy count data should be provided in the runtime by satisfying some condition, just to check I have created a compile time value
let dummyCount = ["5", "10", "2", "3","6","1", "5", "2"]
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return xxx.count
return dummyCount.count
}
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "statusDisplayCell", for: indexPath) as! statusDisplayCollectionViewCell
cell.countOfStatusCell.text = dummyCount[indexPath.row]
cell.xxxCell.text = xxx[indexPath.row]
return cell
}