Search bar does not appear in header of UICollectionView when I run my project
<p>How I should do right with this issue? I don't know how I can integrate Search Bar with UICollectionView correctly. Please help me understand this problem. </p>

<p>P.S. My language is Swift</p>

<p><img src="https://i.stack.imgur.com/zKwSM.png" alt="My view in Interface Builder ">[1]</p>

<p><img src="https://i.stack.imgur.com/8g4oM.png" alt="My view when I run project ">[2]</p>

<p><pre>
import UIKit</p>

<p>class MainViewController: UICollectionViewController {</p>

<pre><code>override func viewDidLoad() {
    super.viewDidLoad()
}



override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
    return 14
}

override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
    let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "TrendingGifCell", for: indexPath)
    return cell
}
</code></pre>

<p>}</p>

<p></pre></p>