UICollectionView

class UICollectionView : UIScrollView, UIDataSourceTranslating
  • The center point of UICollectionView

    Declaration

    Swift

    public var centerPoint: CGPoint { get }
  • Set a UIRefreshControl

    Declaration

    Swift

    @available(iOS 10.0, *)
    @discardableResult
    public func setRefreshControl(_ target: Any?, with action: Selector, tintColor: UIColor = .white) -> UIRefreshControl

    Parameters

    target

    Any?

    action

    The selector action with swipe

    tintColor

    the activity indicator tintColor. default = .white

    Return Value

    @discardableResult UIRefreshControl which was assigne to UICollectionView

  • Register UICollectionReusableView.Type‘s

    Declaration

    Swift

    public func register(headerTypes: UICollectionReusableView.Type...)

    Parameters

    headerTypes

    UICollectionViewCell.Type‘s

  • Register UICollectionReusableView.Type

    Declaration

    Swift

    public func register(headerType: UICollectionReusableView.Type)

    Parameters

    headerType

    UICollectionReusableView.Type

  • Register UICollectionViewCell.Type‘s

    Declaration

    Swift

    public func register(cellTypes: UICollectionViewCell.Type...)

    Parameters

    cellTypes

    UICollectionViewCell.Type‘s

  • Register UICollectionViewCell.Type

    Declaration

    Swift

    public func register(cellType: UICollectionViewCell.Type)

    Parameters

    cellType

    UICollectionViewCell.Type

  • Dequeue generic type element of UICollectionViewCell for indexPath

    Declaration

    Swift

    public func dequeue<Element>(cellType: Element.Type, for indexPath: IndexPath) -> Element where Element : UICollectionViewCell

    Parameters

    cellType

    Element.Type

    indexPath

    cell for IndexPath

  • Dequeue header generic type element of UICollectionReusableView for indexPath

    Declaration

    Swift

    public func dequeueHeader<Element>(cellType: Element.Type, for indexPath: IndexPath) -> Element where Element : UICollectionReusableView

    Parameters

    cellType

    Element.Type

    indexPath

    header for IndexPath

  • setAutomaticSize will set the estimated item size as UICollectionViewFlowLayoutAutomaticSize

    Since

    First available in iOS 10.0

    Declaration

    Swift

    @available(iOS 10.0, *)
    public func setAutomaticSize(_ height: CGFloat = 250)
  • Set minimum line and interitem spacing

    Declaration

    Swift

    public func set(spacing: CGFloat)

    Parameters

    spacing

    The minimum spacing