I want to add a vertical collection view that contains 7 static cells. I know how to do it dynamically, but i don't see a reason to do so.
Do i have to use the cellForRow method? I Added a collection view to my viewController, and added 4 cells, wired up the delegate from the collectionView to the vc (using storyBoard), but when i run it it shows me an empty collectionView.
I did set up the numberOfSections to return 1 and the numberOfCellsInSection to return 7. So did i miss anything? or do i have to conform to DataSource protocol and implement the cellForRow method ? (in TableView i can skip the cellForRow when using static cells).
Thanks for the help.
From the official document:
Every collection view must have a data source object. The data source object is the content that your app displays. It could be an object from your app’s data model, or it could be the view controller that manages the collection view. The only requirement of the data source is that it must be able to provide information that the collection view needs, such as how many items there are and which views to use when displaying those items.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With