I am (slowly) progressing on building a cookbook app for my mother’s recipes.
I have built a ContentsViewController, in which I have a UICollectionView that displays a collection of Chapters in the body of the screen. The ChapterCell has a chapterImage and a chapterName.
When a user taps a Chapter, the screen segues to the ChapterViewController. The collection of Chapters then displays in the left-hand column, and a table of recipes will appear in the body of the screen.
My intention is to re-use the ChapterCell in that left-hand column, but when I do, I get the following app crash in AppDelegate
unexpectedly found nil while unwrapping an optional value uicollectionviewcell
I have put a breakpoint in and done various versions of ‘po chapter’ through to ‘po chapterToDisplay!chapterName’ and values are returned.
As a workaround to keep me going, I have created an almost identical ChapterCell and called it ChapChapterCell. BUT this is going to gnaw away at me, and would like to know one way or the other.
Having googled around, I can see stuff about using multiple collection view in a view controller, but nothing much about what I am trying to do.
… So can multiple view controllers use a single uicollectionviewcell?