navigate on click of collectionview cell inside tableview

后端 未结 4 934
悲&欢浪女
悲&欢浪女 2020-12-18 15:49

I have a tableview cell inside which i have added collectionview cell ( for horizontal scrolling).

Now i want to push to other navigation controller on pressing any

4条回答
  •  悲&欢浪女
    2020-12-18 16:15

    First create protocol for delegation from CategoryRow.swift like below code

    protocol CollectionViewSelectionDelegate: class {
        func didSelectedCollectionViewItem(selectedObject: AnyObject)
    }
    

    Now create delegate object on VideoCell.swift like below

    weak var delegate:CollectionViewSelectionDelegate? 
    

    Change ViewController.swift code before return cell

    cell?.delegate = self
    

    Override method of delegate in ViewController.swift and call similar method from VideoCell.swift from UICollectionView Delegate method.

提交回复
热议问题