Collection View Cells not appearing

前端 未结 14 1129
迷失自我
迷失自我 2021-02-07 08:40

I want to display as many collectionViewCells with buttons as there are strings in my array. but when I start the simulator there is just the backgroun

14条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-07 09:30

    First of all check you have used this method:-

    override func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
    return searches.count
    }
    

    There’s one search per section, so the number of sections is the count of the searches array. so also we can use as per needed this method.by default we can use retuen 1

    And Follow step in the Link for better soluation Check this link

提交回复
热议问题