Swiftpack.co - FadiOssama/Reusable as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by FadiOssama.
FadiOssama/Reusable 0.1.0
Reuse cell or header of TableView or CollectionView without indicating the reuse identifier by just telling the compiler the type of the cell instead of inferring it
⭐️ 4
🕓 3 years ago
iOS macOS
.package(url: "https://github.com/FadiOssama/Reusable.git", from: "0.1.0")

Reusable

Reuse cell or header of UITableView or UICollectionView without indicating the reuse identifier by just telling the compiler the type of the cell instead of inferring it.By specifying the type you'll optimize the type inference time and will be able to get the reusable component without the need to explicitly type the reuse identifier.

Example:

let bannerCollectionViewCell: BannerCollectionViewCell = collectionView.dequeueReusableCell(indexPath: indexPath)

This line of code indicates the type of the cell to BannerCollectionViewCell which lets the compiler know the reuseIdentifier so it can dequeue it without the explicit declaration of it.

Same behaviour is applied to UITableView.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics