AbstractCollectionDelegate

@available(*, deprecated, message: "Migrate to `CollectionDelegate` https://github.com/stanwood/SourceModel_iOS")
open class AbstractCollectionDelegate : NSObject, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, CollectionDelegate, DelegateSourceType

The AbstractCollectionDelegate conforms to the CollectionDelegate protocol. It allows you to manage the selection and highlighting of items in a collection view and to perform actions on those items. UICollectionView.

Example: DataSource and Delegate design
let items = [Element(id: "1"), Element(id: "2")]
self.objects = Stanwood.Elements<Element>(items: items)

self.dataSource = ElementDataSource(dataObject: objects)
self.delegate = ElementDelegate(dataObject: objects)

self.collectionView.dataSource = self.dataSource
self.collectionView.delegate = self.delegate

See also

AbstractCollectionDataSource

Objects

DataType

Type

  • dataObject, a collection of types

    Declaration

    Swift

    public internal(set) var dataType: DataType? {
      get
      }
  • A single type object to present

    Declaration

    Swift

    public internal(set) var type: Type? {
      get
      }
  • Initialise with a collection of types

    See also

    DataType

    Declaration

    Swift

    public init(dataType: DataType?)

    Parameters

    dataObject

    dataObject

  • Initialise with a a single type object.

    See also

    Type

    Declaration

    Swift

    public init(type: Type)

    Parameters

    dataType

    DataType

  • update current dataSource with dataObject.

    Note: If data type is a class, it is not reqruied to update the dataType.

    See also

    Type

    Declaration

    Swift

    open func update(with dataType: DataType?)

    Parameters

    dataObject

    DataType

  • update current dataSource with dataType.

    Note: If data type is a class, it is not reqruied to update the dataType.

    See also

    DataType

    Declaration

    Swift

    open func update(with type: Type?)

    Parameters

    dataType

    Type