Latest 0.0.4
License MIT
Platforms ios 8.0, requires ARC

About StaticCellKit

Dequeue a static cell of indexPath,

and the cell will never be reused by other indexPath.


  • iOS 8.0
  • XCode 8.0
  • Swift 3.0


// Swift 3.2
pod 'StaticCellKit', '~> 0.0.3’
// Swift 4.0
pod 'StaticCellKit', '~> 0.0.4’

Why do I use StaticCellKit?

Sometimes we need to make a page like Settings. In this page, every row has different subviews.

It’s no need to create many UITableViewCell subclasses and to reuse cells.

We just need a table view with static cells and add subviews directly in view controller’s implementment.

As we known, we can create a static table view in StoryBoard.

By code, we can use this kit.



这时候,如果有一个static table view,我们直接在view controller的实现中为cell添加子视图就方便很多。

StoryBoard中我们可以直接创建static table view



func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell: CustomTableViewCell = tableView.sck.dequeueStaticCell(indexPath)

    return cell

func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
    guard section == 0 else { return nil }
    let header = tableView.sck.dequeueStaticHeaderView(section)

    return header

func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
    guard section == 0 else { return nil }
    let footer = tableView.sck.dequeueStaticFooterView(section)

    return footer

It will dequeue a cell which is CustomTableView type.

You don’t need to call UITableView.registerClass(_:).

tableView.sck.delegate = self  

// `self` may be your view controller which conforming StaticTableViewDelegate.

extension ViewController: StaticTableViewDelegate {

   func tableView(_ tableView: UITableView, initStaticCell cell: UITableViewCell, ofIndexPath indexPath: IndexPath) {


   func tableView(_ tableView: UITableView, initStaticHeader header: UITableViewHeaderFooterView, ofSection section: Int) {


   func tableView(_ tableView: UITableView, initStaticFooter footer: UITableViewHeaderFooterView, ofSection section: Int) {



You can use StaticTableViewDelegate to configure cell or header / footer.

Latest podspec

    "name": "StaticCellKit",
    "version": "0.0.4",
    "summary": "Create a static table view by code!",
    "description": "Dequeue a static cell of indexPath,nand the cell will never be reused by other indexPath.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "MangoMade": "[email protected]"
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "0.0.4"
    "source_files": "Source/*.swift",
    "requires_arc": true,
    "pushed_with_swift_version": "4.0"

Pin It on Pinterest

Share This