Having a problem using Interface Builder to create the Section Header Reusable view rather than using the manually coded one that comes with the lesson.
After checking the “Accessories - Section Header” in the Collection View IB, I layout the Header in IB.
Then, I create a simple supplementary header “SectionHeaderReusableViewIB” and use it as the class for the header Interface Builder with a subclassed UICollectionReusableView to match it instead of using the "SectionHeaderReusableView”.
I then change the code from using “SectionHeaderReusableView” to “SectionHeaderReusableViewIB”.
Unfortunately, when I run the app and reach the following logic:
view?.titleLabel.text = section.title
The titleLabel is nil and the app bombs.
A reusable view is returned fine, but the titleLabel is nil.
When I change it to:
view?.titleLabel?.text = section.title
The app runs fine, but the title does not display.
Does that mean using the Diffable Data method way, Reusable Views must be coded manually rather than using Interface Builder?