ReusableViewConfiguration
public struct ReusableViewConfiguration<View, Object> : ReusableViewConfiguring
The reusable view configuration can decide if it can configure a given view with an object or not. If matching, it is able to configure the view with the object. It knows the reuse identifier of the cell
Note
Dequeuing a view is not part of configuration.-
The reuse identifier which will be used to register and deque the cell.
Declaration
Swift
public let reuseIdentifier: String -
The type of the cell.
Declaration
Swift
public var type: ReusableViewType -
A block to configure the view with given object at the given index path.
Declaration
Swift
public let configuration: ((View, IndexPath, Object) -> Void)? -
Creates an instance of
ReusableViewConfiguration.Declaration
Swift
public init(reuseIdentifier: String, type: ReusableViewType = .cell, configuration: ((View, IndexPath, Object) -> Void)?)Parameters
reuseIdentifierthe reuse identifier for registering & dequeuing views
typethe type of the Reusable view
configurationa block to configure the view with given object at the given index path.
-
Configures the given view with at the index path with the given object.
Declaration
Swift
public func configure(_ view: View, at indexPath: IndexPath, with object: Object)Parameters
viewthe view to configure
indexPathindex path of the view
objectthe object which relates to the view
-
The reuse identifier which will be used deque the view.
Declaration
Swift
public func reuseIdentifier(for object: Object) -> StringParameters
objectthe object.
Return Value
reuse identifier which fits to object.
-
Undocumented
Declaration
Swift
public init(type: ReusableViewType = .cell, configuration: @escaping ((View, IndexPath, Object) -> Void))
-
Undocumented
Declaration
Swift
public init(reuseIdentifier: String, type: ReusableViewType = .cell, additionalConfiguration: ((View, IndexPath, Object) -> Void)? = nil)
-
Undocumented
Declaration
Swift
public init(type: ReusableViewType = .cell, additionalConfiguration: ((View, IndexPath, Object) -> Void)? = nil)
View on GitHub
ReusableViewConfiguration Structure Reference