mirror of
https://github.com/confirmedcode/Lockdown-iOS.git
synced 2025-12-21 12:14:02 +01:00
20 lines
467 B
Swift
20 lines
467 B
Swift
//
|
|
// UICollectionView+Dequeue.swift
|
|
// Lockdown
|
|
//
|
|
// Created by Alexander Parshakov on 9/5/22
|
|
// Copyright © 2022 Confirmed Inc. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
protocol Dequeuable: UIView {
|
|
static var dequeuableId: String { get }
|
|
}
|
|
|
|
extension UICollectionView {
|
|
func dequeueCell<T>(for: T, indexPath: IndexPath) -> T? where T : Dequeuable {
|
|
return dequeueReusableCell(withReuseIdentifier: T.dequeuableId, for: indexPath) as? T
|
|
}
|
|
}
|