Latest0.1.0
Homepagehttps://github.com/kimdv/SwiftyReuse
LicenseMIT
Platformsios 11.0
Authors
A micro framework that makes it more pretty to register and dequeue cells in UITableView and UICollectionView.

Introduction

The UIKit way of registering UITableView or UICollectionView cells is not that sweet 🙈🙈🙈

self.tableView.register(UINib(nibName: "Cell", bundle: nil), forCellReuseIdentifier: "CellIdentifier")

And dequeue

return tableView.dequeueReusableCell(withIdentifier: "CellIdentifier", for: indexPath) as! CustomCell

Let’s do that better with the power of Swift ! 🚀🚀🚀

class ViewController {
    func viewDidLoad() {
        self.collectionView.register(Cell.self)
    }

    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        return collectionView.dequeue(Cell.self, for: indexPath)
    }   
}

And that’s it! 😱😱😱

Latest podspec

{
    "name": "SwiftyReuse",
    "version": "0.1.0",
    "summary": "A microframework that makes register dequeuing of cells in UICollectionView and UITableView pretier.",
    "authors": {
        "Kim de Vos": "[email protected]"
    },
    "homepage": "https://github.com/kimdv/SwiftyReuse",
    "social_media_url": "http://twitter.com/kimdv",
    "license": "MIT",
    "source": {
        "git": "https://github.com/kimdv/SwiftyReuse.git",
        "tag": "0.1.0"
    },
    "source_files": "Sources/**/*.swift",
    "platforms": {
        "ios": "11.0"
    }
}

Pin It on Pinterest

Share This