You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
/*********************************************
|
|
*
|
|
* This code is under the MIT License (MIT)
|
|
*
|
|
* Copyright (c) 2016 AliSoftware
|
|
*
|
|
*********************************************/
|
|
|
|
import UIKit
|
|
|
|
// MARK: Protocol definition
|
|
|
|
/// Make your `UITableViewCell` and `UICollectionViewCell` subclasses
|
|
/// conform to this protocol when they are *not* NIB-based but only code-based
|
|
/// to be able to dequeue them in a type-safe manner
|
|
public protocol Reusable: class {
|
|
/// The reuse identifier to use when registering and later dequeuing a reusable cell
|
|
static var reuseIdentifier: String { get }
|
|
}
|
|
|
|
/// Make your `UITableViewCell` and `UICollectionViewCell` subclasses
|
|
/// conform to this typealias when they *are* NIB-based
|
|
/// to be able to dequeue them in a type-safe manner
|
|
public typealias NibReusable = Reusable & NibLoadable
|
|
|
|
// MARK: - Default implementation
|
|
|
|
public extension Reusable {
|
|
/// By default, use the name of the class as String for its reuseIdentifier
|
|
static var reuseIdentifier: String {
|
|
return String(describing: self)
|
|
}
|
|
}
|