FSPagerView icon indicating copy to clipboard operation
FSPagerView copied to clipboard

How to get the numberOfItems

Open norman93sun opened this issue 2 years ago • 2 comments

  internal var numberOfItems: Int = 0
  internal var numberOfSections: Int = 0

Coz it's internal.

norman93sun avatar Jul 15 '21 10:07 norman93sun

As part of UICollectionViewDataSource you provide this information:

public func numberOfSections(in collectionView: UICollectionView) -> Int {} Since you're providing the data, you know the number of items you're using. You don't access the internal numberOfItems variable

Mozahler avatar Jul 15 '21 15:07 Mozahler

     if let numberOfItems = pageView.dataSource?.numberOfItems(in: pageView), numberOfItems > 0 {
          
     }

Should this working?

norman93sun avatar Jul 16 '21 02:07 norman93sun