Adding a section header to the collection view
A collection view can be configured with a section header and a section footer. Both of them are instances of the UICollectionReusableView
class. You will enable the section header for the collection view on the Explore screen, so you'll have a place to put the LOCATION button. Follow these steps:
- Click
Main.storyboard
in the Project navigator and click Collection View in the document outline. Click the Attributes inspector button. Under Collection View, tick the checkbox for Section Header:This enables the section header for the collection view.
- Note that Collection Reusable View appears in the document outline. This represents the collection view section header. Click on Collection Reusable View in the document outline. In the Attributes inspector under Collection Reusable View, set Identifier to
header
and press Return when you're...