UICollectionReusableView

extension UICollectionReusableView: SkeletonViewDelegate
@_spi(FW) extension UICollectionReusableView: DynamicLayoutViewProtocol

UICollectionReusableView骨架屏视图代理扩展

UICollectionReusableView+DynamicLayout

  • 免注册alloc创建UICollectionReusableView,内部自动处理缓冲池,指定reuseIdentifier

    Declaration

    Swift

    public static func fw_reusableView(
        collectionView: UICollectionView,
        kind: String,
        indexPath: IndexPath,
        reuseIdentifier: String? = nil
    ) -> Self
  • 根据配置自动计算view大小,可固定宽度或高度,可指定key使用缓存,子类可重写

    Declaration

    Swift

    public static func fw_size(
        collectionView: UICollectionView,
        width: CGFloat = 0,
        height: CGFloat = 0,
        kind: String,
        cacheBy key: AnyHashable? = nil,
        configuration: (UICollectionReusableView) -> Void
    ) -> CGSize