Skip to content

Instantly share code, notes, and snippets.

@dubemike
dubemike / Genrics+CellReuse.swift
Created June 21, 2018 10:12
An easier way to dequeue cells in iOS
import Foundation
import UIKit
public protocol ReusableView: class {
static var defaultReuseIdentifier: String { get }
}
extension ReusableView where Self: UIView {
public static var defaultReuseIdentifier: String {
return String(describing: self)
}