I want to display UICollectionView inside static TableViewCell
I have a static TableViewCell that contains CollectionView. Well, the problem is that, in my opinion, code looks good but when I launch program, TableViewCell doesn't show me CollectionView. I'm a little bit confused, so I will be so happy if you help me. Thanks
TableViewController Class:
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
var Cell = tableView.dequeueReusableCell(withIdentifier: "Action")
switch indexPath.section {
case 0:
tableView.register(ScheduleCell.self, forCellReuseIdentifier: "Schedule")
Cell = tableView.dequeueReusableCell(withIdentifier: "Schedule") as! ScheduleCell
case 1:
return Cell!
case 2:
tableView.register(MarksCell.self, forCellReuseIdentifier: "Marks")
Cell = tableView.dequeueReusableCell(withIdentifier: "Marks") as! MarksCell
default:
Cell = tableView.dequeueReusableCell(withIdentifier: "Action") as! ActionCell
}
return Cell!
}
ActionCell:
extension ActionCell: UICollectionViewDelegateFlowLayout, UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 3
}
func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ActionCell", for: indexPath) as! ActionsCollectionViewCell
var Labels = ["РАСПИСАНИЕ", "ДОМАШНИЕ ЗАДАНИЯ", "ОЦЕНКИ"]
var Icons = ["Safari", "DZ", "Rating"]
var Colors = [UIColor.init(red: 26/255, green: 196/255, blue: 234/255, alpha: 1),
UIColor.init(red: 251/255, green: 143/255, blue: 25/255, alpha: 1),
UIColor.init(red: 251/255, green: 25/255, blue: 118/255, alpha: 1)]
cell.Title.text = Labels[indexPath.item]
cell.Icon.image = UIImage.init(named: Icons[indexPath.item])
cell.Button.backgroundColor = Colors[indexPath.item]
return cell
}
}
Also, I have to notice that in Storyboard i mentioned all classes and ReuseIDs

delegateanddatasourceof collectionview ?