Hello!
I havу problem with collectionView. I have only one cell but in my array 3 values. What am I doing wrong?
My array:
var notebookItems: [NotebookItem] {
var firstNotebook = NotebookItem()
firstNotebook.name = "Math"
firstNotebook.imageName = "background"
var secondNotebook = NotebookItem()
firstNotebook.name = "English"
firstNotebook.imageName = "background"
var thirdNotebook = NotebookItem()
firstNotebook.name = "Chemistry"
firstNotebook.imageName = "background"
return [firstNotebook,secondNotebook,thirdNotebook]
}
And collectionView(numberOfItemsInSection: ) method:
extension ViewController: UICollectionViewDelegate, UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
print(#function)
return notebookItems.count
}