Swiftpack.co -  lucamegh/ReusableView as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
lucamegh/ReusableView
Type-safe view recycling.
.package(url: "https://github.com/lucamegh/ReusableView.git", from: "1.0.0")

ReusableView ♻️

ReusableView was primarly developed for Lists.

Installation

ReusableView is distributed using Swift Package Manager. To install it into a project, simply add it as a dependency within your Package.swift manifest:

let package = Package(
    ...
    dependencies: [
        .package(url: "https://github.com/lucamegh/ReusableView", from: "1.0.0")
    ],
    ...
)

Usage

Registering cells

Vanilla UIKit:

tableView.register(ArticleCell.self, forCellReuseIdentifier: "ArticleCell")

ReusableView:

tableView.register(ArticleCell.self)

Using Nibs? Make your cell conform to NibLoadableView and call registerNib.

Dequeuing cells

Vanilla UIKit:

collectionView.dequeueReusableCell(withReuseIdentifier: "PostCell", for: indexPath) as! PostCell

ReusableView:

collectionView.dequeue(PostCell.self, for: indexPath)

You can also dequeue and configure cells right away:

collectionView.dequeue(ArticleCell.self, for: indexPath) { cell in
    // cell configuration goes here
}

GitHub

link
Stars: 0
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

ReusableView 1.0.0
2 weeks ago

The first release of ReusableView.

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