CollectionDelegateControllerProtocol

@MainActor
public protocol CollectionDelegateControllerProtocol : ViewControllerProtocol, UICollectionViewDelegate

集合代理控制器协议,数据源和事件代理为collectionDelegate,可覆写

  • 关联表格数据元素类型,默认Any

    Declaration

    Swift

    associatedtype CollectionElement = Any
  • 集合视图,默认不显示滚动条

    Declaration

    Swift

    @MainActor
    var collectionView: UICollectionView { get }
  • 集合代理,同集合collectionDelegate,延迟加载

    Declaration

    Swift

    @MainActor
    var collectionDelegate: CollectionViewDelegate { get }
  • 集合数据,默认空数组,延迟加载

    Declaration

    Swift

    @MainActor
    var collectionData: [CollectionElement] { get set }
  • 渲染集合视图内容布局,只调用一次

    Declaration

    Swift

    @MainActor
    func setupCollectionViewLayout() -> UICollectionViewLayout
  • 渲染集合视图,setupSubviews之前调用,默认空实现

    Declaration

    Swift

    @MainActor
    func setupCollectionView()
  • 渲染集合视图布局,setupSubviews之前调用,默认铺满

    Declaration

    Swift

    @MainActor
    func setupCollectionLayout()

Available where Self: UIViewController

  • collectionView Default implementation

    Default Implementation

    集合视图,默认不显示滚动条

    Declaration

    Swift

    @MainActor
    public var collectionView: UICollectionView { get }
  • collectionDelegate Default implementation

    Default Implementation

    集合代理,同集合collectionDelegate,延迟加载

    Declaration

    Swift

    @MainActor
    public var collectionDelegate: CollectionViewDelegate { get }
  • collectionData Default implementation

    Default Implementation

    集合数据,默认空数组,延迟加载

    Declaration

    Swift

    @MainActor
    public var collectionData: [CollectionElement] { get set }
  • setupCollectionViewLayout() Default implementation

    Default Implementation

    渲染集合视图内容布局,只调用一次

    Declaration

    Swift

    @MainActor
    public func setupCollectionViewLayout() -> UICollectionViewLayout
  • setupCollectionView() Default implementation

    Default Implementation

    渲染集合视图,setupSubviews之前调用,默认空实现

    Declaration

    Swift

    @MainActor
    public func setupCollectionView()
  • setupCollectionLayout() Default implementation

    Default Implementation

    渲染集合视图布局,setupSubviews之前调用,默认铺满

    Declaration

    Swift

    @MainActor
    public func setupCollectionLayout()