In My Project I created Cell in UICollectionViewCell
Its got Error Terminating app due to uncaught exception
The code as follow.
GalleryCell.
the same for header/footer in swift:
// register header accessory view: self.collectionView.registerClass(UICollectionReusableView.self, forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, withReuseIdentifier: headerReuseIdentifier);