Can´t add items to UICollectionView inside UIView xib

后端 未结 5 1767
说谎
说谎 2021-02-05 09:20

Objective

I wanna place my (BusinessViewTableHeader: UIView) as tableView header:

tableView.tableHeaderView = BusinessViewTableHeader.instanceFromNib() a         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 09:51

    Same as @Pato's answer, but here is a more thorough tutorial for how to add a customized UICollectionViewCell inside a Xib file from @aestusLabs on Medium. It's a 3-5 min reading, I personally find it very helpful. It basically tells you to create another customized UICollectionViewCell with .xib, and register it in your "level 1" cell's awakeFromNib().

    https://medium.com/@aestusLabs/adding-a-uicollectionviews-to-a-custom-uitableviewcell-xib-tutorial-swift-4-xcode-9-2-1ec9ce4095d3

提交回复
热议问题