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
Your problem is in
func collectionView(collectionView: UICollectionView, numberOfItemsSection section: Int)
method signature. It is wrong. It should be
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
and with override
specification (because UICollectionViewController
has own, this why you get empty collection).
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return Array.count
}