Skip to content
ReusableCell
Swift Objective-C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ReusableCell-iOS
ReusableCellExample.xcodeproj
ReusableCellExample
src
.swiftlint.yml
README.md

README.md

Carthage compatible SwiftLint Sindre

ReusableCell

  • Makes dequeuing cells simpler
  • Supports UITableView and UICollectionView
  • Supports UITableViewCell and UICollectionViewCell

Example 1:

import ReusableCell_iOS
tableView.register(CustomCell.self) // Register Cells with ease
extension CustomCell: ReusableCell {} // Make your custom cells
let cell: CustomCell = tableView.dequeueReusableCell(for: indexPath) // Instantiate your cells
// In the cell:
extension CustomCell: ReusableCellKind { // make your subclass conform to the protocol
  open class var defaultReuseIdentifier: String { return "\(TextCell.self)" }
}

Example 2:

import CommonCell
import With
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  return with(tableView.dequeueReusableCell(indexPath: indexPath) as TextCell) {
     $0.backgroundColor = .clear
     $0.data = rowData[indexPath.row] // populate cell with data
  }
}

Install:

  • Carthage: github "eonist/ReusableCell" "master"
  • Manual: Open ReusableCellExample.xcodeproj
  • CocoaPod (Coming soon)
You can’t perform that action at this time.