         super.init(collectionViewLayout: UICollectionViewFlowLayout())
     }
 
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+
+        ImagePipeline.Configuration.isAnimatedImageDataEnabled = true
+    }
+
+    override func viewWillDisappear(_ animated: Bool) {
+        super.viewWillDisappear(animated)
+
+        ImagePipeline.Configuration.isAnimatedImageDataEnabled = false
+    }
+
     override func viewDidLoad() {
         super.viewDidLoad()
 
-        collectionView?.register(HeaderCell.self, forCellWithReuseIdentifier: headerCellReuseId)
         collectionView?.register(AnimatedImageCell.self, forCellWithReuseIdentifier: imageCellReuseID)
 
         if #available(iOS 13.0, *) {

    }

    override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        switch indexPath.section {
        case 0:
            return collectionView.dequeueReusableCell(withReuseIdentifier: headerCellReuseId, for: indexPath)
        default:
            let cell = collectionView.dequeueReusableCell(withReuseIdentifier: imageCellReuseID, for: indexPath) as! AnimatedImageCell
            cell.setImage(with: imageURLs[indexPath.row])
            return cell
        }
    }

    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        let layout = collectionViewLayout as! UICollectionViewFlowLayout
        let width = view.bounds.size.width - layout.sectionInset.left - layout.sectionInset.right
        switch indexPath.section {
        case 0:
            return CGSize(width: width, height: 50)
        default:
            return CGSize(width: width, height: width)
        }
    }
}

private let headerCellReuseId = "headerCellReuseID"
private let imageCellReuseID = "imageCellReuseID"

// MARK: - Image URLs

        imageView.prepareForReuse()
    }
}
