IdentifiableComponent
public protocol IdentifiableComponent : CellsBuildable, Component
Represents a component that can be uniquely identify.
Example for the simple identified component:
struct UserLabel: IdentifiableComponent {
var id: Int64
var name: String
func renderContent() -> UILabel {
return UILabel()
}
func render(in content: UILabel) {
content.text = name
}
}
-
A type that represents an id that used to uniquely identify the component.
Declaration
Swift
associatedtype ID : Hashable
-
id
Default implementationAn identifier that used to uniquely identify the component.
Default Implementation
An identifier that can be used to uniquely identify the component. Default is
self
.Declaration
Swift
var id: ID { get }
-
buildCells()
Extension methodBuild an array of section.
Declaration
Swift
func buildCells() -> [CellNode]