Ok I have a custom sticker app wherein Im trying to accomplish this effect, the background view behind rest of the cells:
So far Ive created my background view:
self.addSubview(bgView)
self.sendSubviewToBack(bgView)
and tried
func collectionView(_ collectionView: UICollectionView,
viewForSupplementaryElementOfKind kind: String,
at indexPath: IndexPath) -> UICollectionReusableView {
let headerView: HeaderCollectionReusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "headerCell", for: indexPath as IndexPath) as! HeaderCollectionReusableView
self.view.sendSubviewToBack(headerView)
but the background view still appears on top of the cells. How can I do this?
Interesting effect!
Have you tried:
Container View
Collection view
(with a transparent background)Example:
Storyboard
Result
Runtime