API.md

December 3, 2018 ยท View on GitHub

CenteredCollectionViewFlowLayout API

You can use all properties inherited from UICollectionViewFlowLayout.

CenteredCollectionViewFlowLayout specific properties:

  • currentCenteredPage calculates the current centered page

    var currentCenteredPage: Int? { get }
    
  • scrollDirection direction of scrolling (supports vertical)

    var scrollDirection: UICollectionView.ScrollDirection { get set }
    // default: .horizontal
    
  • scrollTo(index: animated:) programmatically scrolls to a item at a specified index.

    func scrollTo(index: Int, animated: Bool)